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
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;
it.only("should show a test failure", () => {
const controller = new AbortController();
expect({ controller }).toMatchObject({ not: "this" });
});
In my case, at least, it crashes with: TypeError: Cannot read property 'includes' of undefined
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:
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.
🐛 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: