react-testing-library: does not play well with jest 27
@testing-library/reactversion:
“@testing-library/jest-dom”: “5.12.0”, “@testing-library/react”: “11.2.7”,
- Testing Framework and version:
“jest”: “27.0.1”,
- DOM Environment:
jsdom
Relevant code or config:
please refer to this project https://github.com/TrejGun/casino
What you did:
updated jest from 26 to 27
What happened:
Tests are now failing with
ReferenceError: clearImmediate is not defined
Reproduction:
see above
Problem description:
Tests are failing 😦
Suggested solution:
N/A
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 25
- Comments: 15 (5 by maintainers)
We’re in the process of fixing this in
@testing-library/dom. This particular issue should already be fixed in the alpha but it’ll take some time to test it before we can release a new major of@testing-library/react.🎉 This issue is fixed in version 12.0.0-alpha.2 🎉
The release is available on:
npm package (@alpha dist-tag)I got this error :
TypeError: Cannot destructure property 'AsymmetricMatcher' of '_prettyFormat.default.plugins' as it is undefinedMy packages installed :
We have the same issue. Trying to update a monorepo with 297 test suites to jest v27 caused a full 47 test suites to fail. A couple of issues I saw:
.finally()timed out and never finished.Date.now.mockClear()threw an error that mockClear wasn’t a function).ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down.. These are probably leaks I could fix if I could figure out which test was being torn down.Jest 27 config file changes I made:
@maximeNaulleau Can you please share which version of
pretty-formatyou have installed? It should be 27^.