Always remove node internals from stacktraces#4695
Conversation
| at promise.then (node_modules/jest-jasmine2/build/queue_runner.js:74:39) | ||
| at <anonymous> | ||
| at process._tickCallback (internal/process/next_tick.js:188:7) | ||
| at internal/process/next_tick.js:188:7 |
There was a problem hiding this comment.
this last one I just saw in the integration tests. It should be the same as the one above it. Ideas?
There was a problem hiding this comment.
Seems to come from the remaining replace in cleanupStackTrace in integration_tests/utils.js. Not sure how to handle it
There was a problem hiding this comment.
If we really want to do it, I can move this next_tick part down there, no reason to have it in message-util
There was a problem hiding this comment.
Figured it out, this is node 4 missing the calling function's name.
|
Heh, breakes the browser test. Fair enough |
| return false; | ||
| } | ||
|
|
||
| if (STACK_TRACE_IGNORE.test(line)) { |
There was a problem hiding this comment.
How about renaming this to JEST_INTERNALS_IGNORE?
| // 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>.*$/; |
| .replace(/\n.*at.*next_tick\.js.*$/gm, '') | ||
| .replace(/\n.*at (new )?Promise \(<anonymous>\).*$/gm, '') | ||
| .replace(/\n.*at <anonymous>.*$/gm, '') | ||
| .replace(/\n.*at Generator.next \(<anonymous>\).*$/gm, '') |
integration_tests/utils.js
Outdated
| .replace(/\n.*at.*timers\.js.*$/gm, '') | ||
| .replace(/\n.*at.*assert\.js.*$/gm, '') | ||
| .replace(/\n.*at.*node\.js.*$/gm, '') | ||
| .replace(/\n.*at.*next_tick\.js.*$/gm, '') |
There was a problem hiding this comment.
Looks like this needs to be updated on Node 4? Not sure why it fails now though.
There was a problem hiding this comment.
next_tick is not under internal/ on node 4...
There was a problem hiding this comment.
It's not the integration test which fails, it's the new test I added in message-utils
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
As discussed in #4686, this removes node core stuff from the stacktraces we present to the user, not just from our own tests.
Stack trace with this PR:

Without this PR:

Test plan
New test added