Skip to content

Commit 0769ee9

Browse files
committed
full stack trace
1 parent d340bc6 commit 0769ee9

File tree

1 file changed

+2
-63
lines changed

1 file changed

+2
-63
lines changed

packages/jest-message-util/src/index.ts

+2-63
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ const stackUtils = new StackUtils({
2626
cwd: 'something which does not exist',
2727
});
2828

29-
let nodeInternals: RegExp[] = [];
30-
31-
try {
32-
nodeInternals = StackUtils.nodeInternals();
33-
} catch (e) {
34-
// `StackUtils.nodeInternals()` fails in browsers. We don't need to remove
35-
// node internals in the browser though, so no issue.
36-
}
37-
3829
export type StackTraceConfig = Pick<
3930
Config.ProjectConfig,
4031
'rootDir' | 'testMatch'
@@ -48,12 +39,6 @@ const PATH_NODE_MODULES = `${path.sep}node_modules${path.sep}`;
4839
const PATH_JEST_PACKAGES = `${path.sep}jest${path.sep}packages${path.sep}`;
4940

5041
// filter for noisy stack trace lines
51-
const JASMINE_IGNORE = /^\s+at(?:(?:.jasmine\-)|\s+jasmine\.buildExpectationResult)/;
52-
const JEST_INTERNALS_IGNORE = /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/;
53-
const ANONYMOUS_FN_IGNORE = /^\s+at <anonymous>.*$/;
54-
const ANONYMOUS_PROMISE_IGNORE = /^\s+at (new )?Promise \(<anonymous>\).*$/;
55-
const ANONYMOUS_GENERATOR_IGNORE = /^\s+at Generator.next \(<anonymous>\).*$/;
56-
const NATIVE_NEXT_IGNORE = /^\s+at next \(native\).*$/;
5742
const TITLE_INDENT = ' ';
5843
const MESSAGE_INDENT = ' ';
5944
const STACK_INDENT = ' ';
@@ -152,54 +137,8 @@ export const formatExecError = (
152137

153138
const removeInternalStackEntries = (
154139
lines: string[],
155-
options: StackTraceOptions,
156-
): string[] => {
157-
let pathCounter = 0;
158-
159-
return lines.filter(line => {
160-
if (ANONYMOUS_FN_IGNORE.test(line)) {
161-
return false;
162-
}
163-
164-
if (ANONYMOUS_PROMISE_IGNORE.test(line)) {
165-
return false;
166-
}
167-
168-
if (ANONYMOUS_GENERATOR_IGNORE.test(line)) {
169-
return false;
170-
}
171-
172-
if (NATIVE_NEXT_IGNORE.test(line)) {
173-
return false;
174-
}
175-
176-
if (nodeInternals.some(internal => internal.test(line))) {
177-
return false;
178-
}
179-
180-
if (!STACK_PATH_REGEXP.test(line)) {
181-
return true;
182-
}
183-
184-
if (JASMINE_IGNORE.test(line)) {
185-
return false;
186-
}
187-
188-
if (++pathCounter === 1) {
189-
return true; // always keep the first line even if it's from Jest
190-
}
191-
192-
if (options.noStackTrace) {
193-
return false;
194-
}
195-
196-
if (JEST_INTERNALS_IGNORE.test(line)) {
197-
return false;
198-
}
199-
200-
return true;
201-
});
202-
};
140+
_options: StackTraceOptions,
141+
): string[] => lines;
203142

204143
const formatPaths = (
205144
config: StackTraceConfig,

0 commit comments

Comments
 (0)