-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Crash when pretty-printing AbortController / AbortSignal #10770
Labels
Comments
@SimenB Can you point towards the corresponding potential code that might be causing this bug? |
I know how to fix it. I will create a PR in this week.😃 |
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
🐛 Bug Report
In some cases, when an
expect
fails such that the message would include an AbortController or an AbortSignal, Jest crashes instead of displaying the test failure.To Reproduce
Steps to reproduce the behavior:
Run a test like this one;
In my case, at least, it crashes with: TypeError: Cannot read property 'includes' of undefined
Expected behavior
It should report a test failure.
envinfo
I’m using: "babel-jest": "^26.5.2", "jest": "^26.5.3", "jest-extended": "^0.11.5"
More info:
The exact crash depends on the matcher. If you use something like
toIncludeSameMembers
from jest-extended (which I think uses Jest’s code to print its errors) the crash is different (it seemed to happen in another place). I don’t know if Jest’s built-in matchers can do that as well, I have not tried all of them.A similar crash happens if the matched object contains a reference to controller.signal instead.
The text was updated successfully, but these errors were encountered: