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

Unintended consequence of internal-only stack trace override #9837

Closed
chet-manley opened this issue Apr 18, 2020 · 3 comments
Closed

Unintended consequence of internal-only stack trace override #9837

chet-manley opened this issue Apr 18, 2020 · 3 comments

Comments

@chet-manley
Copy link

chet-manley commented Apr 18, 2020

💥 Regression Report

When creating custom matchers that throw exceptions on invalid arguments, the displayed stack trace goes all the way back to the matcher definition, where the error is thrown. The resulting console output highlights where the throw occurred within the matcher definition, instead of which expect failed within the test. I traced this behavior back to #5162, where default behavior was changed to only match errors with matcher[INTERNAL_MATCHER_FLAG] set to true. Currently (v25.x), this appears to be handled here.

Last working version

I'm not sure what version master was at when the PR was merged, but it appears to be 21 or 22.

To Reproduce

  • Create an external matcher that throws an exception when provided invalid argument(s).
  • Call matcher with invalid argument(s).

Expected behavior

Console output should be the same as what is displayed when an internal matcher fails an argument check.

Link to repl or repo (highly encouraged)

repl.it demo

Run npx envinfo --preset jest

  System:
    OS: Linux 5.5 Fedora 31 (Workstation Edition) 31 (Workstation Edition)
    CPU: (4) x64 Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
  Binaries:
    Node: 13.13.0 - /usr/bin/node
    npm: 6.14.4 - /usr/bin/npm
  npmPackages:
    jest: ^25.3.0 => 25.3.0
@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 25, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions
Copy link

github-actions bot commented May 4, 2022

This issue 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 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant