Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cleanupStackTrace work on older and newer Node 8 version #4686

Merged
merged 1 commit into from
Oct 13, 2017

Conversation

thymikee
Copy link
Collaborator

Summary

As @SimenB pointed out in #4680 (comment) the regex should be updated, so it works on older and newer versions of Node 8

Test plan

Make sure all CI pass.

@@ -162,7 +162,7 @@ const cleanupStackTrace = (output: string) => {
.replace(/\n.*at.*assert\.js.*$/gm, '')
.replace(/\n.*at.*node\.js.*$/gm, '')
.replace(/\n.*at.*next_tick\.js.*$/gm, '')
.replace(/\n.*at (new)? Promise \(<anonymous>\).*$/gm, '')
.replace(/\n.*at (new )?Promise \(<anonymous>\).*$/gm, '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have unit tests for out test utils? 😀

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't be the one writing them 😄

Copy link
Member

@SimenB SimenB Oct 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think this should be stripped in here:https://github.com/facebook/jest/blob/8a427ebba88c6ab15da7c987716216728f5ea093/packages/jest-message-util/src/index.js#L150-L166

It being in the stack is not helpful at all (along with at <anonymous> and process._tickCallback (the latter should be stripped by removeInternalStackEntries already, shouldn't it?)), so why not just remove it for everyone, not just in the test utils for the integration tests?

image

Only the first line in the stack is useful. (Ignore the "expected" part, it's from another matcher)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a fan of removing at process._tickCallback and at <anonymous> without any further info (like line number) from the stack trace 👍.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do that, I think you can remove the line with a diff in this PR entirely

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to modify this PR or send a followup when we have the discussed behavior merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this should probably be merged in the meantime

@codecov-io
Copy link

Codecov Report

Merging #4686 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4686   +/-   ##
=======================================
  Coverage   57.13%   57.13%           
=======================================
  Files         195      195           
  Lines        6569     6569           
  Branches        3        3           
=======================================
  Hits         3753     3753           
  Misses       2816     2816

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a427eb...26a90f5. Read the comment docs.

@cpojer cpojer merged commit 4aa5229 into jestjs:master Oct 13, 2017
@thymikee thymikee deleted the fix/node-8.7-test branch March 16, 2019 10:56
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants