You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
💥 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 withmatcher[INTERNAL_MATCHER_FLAG]
set totrue
. 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
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
The text was updated successfully, but these errors were encountered: