Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename some regexpes
  • Loading branch information
SimenB committed Oct 14, 2017
commit 3c294ee62debf7515f0bac8b09a80fc5e56bcac7
8 changes: 4 additions & 4 deletions packages/jest-message-util/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type StackTraceOptions = {

// filter for noisy stack trace lines
const JASMINE_IGNORE = /^\s+at(?:(?:.*?vendor\/|jasmine\-)|\s+jasmine\.buildExpectationResult)/;
const STACK_TRACE_IGNORE = /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/;
const ANONYMOUS_TRACE_IGNORE = /^\s+at <anonymous>.*$/;
const JEST_INTERNALS_IGNORE = /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/;
const ANONYMOUS_FN_IGNORE = /^\s+at <anonymous>.*$/;
const ANONYMOUS_PROMISE_IGNORE = /^\s+at (new )?Promise \(<anonymous>\).*$/;
const ANONYMOUS_GENERATOR_IGNORE = /^\s+at Generator.next \(<anonymous>\).*$/;
const TITLE_INDENT = ' ';
Expand Down Expand Up @@ -119,7 +119,7 @@ const removeInternalStackEntries = (lines, options: StackTraceOptions) => {
let pathCounter = 0;

return lines.filter(line => {
if (ANONYMOUS_TRACE_IGNORE.test(line)) {
if (ANONYMOUS_FN_IGNORE.test(line)) {
return false;
}

Expand Down Expand Up @@ -151,7 +151,7 @@ const removeInternalStackEntries = (lines, options: StackTraceOptions) => {
return false;
}

if (STACK_TRACE_IGNORE.test(line)) {
if (JEST_INTERNALS_IGNORE.test(line)) {
return false;
}

Expand Down