Tests not working anymore after updating to version < 24.0.0
See original GitHub issue💥 Regression Report
Today, we’ve updated to the newest version of jest in our TypeScript project. We’ve included jest in our package.json of our project with "jest": "^24.7.1". We’ve also included "jest-when": "^2.4.0".
When we run now our tests, we get 1531 errors that jest wasn’t found:
Cannot find name 'jest'.Cannot find name 'expect'.Cannot find name 'it'. Do you need to install type definitions for a test runner? Trynpm i @types/jestornpm i @types/mochaand then addjestormochato the types field in your tsconfig.
and much more.
We include jest in our spec’s with import 'jest'; at the top.
Does anyone has an idea what could be the problem?
Steps to reproduce the behavior:
Expected behavior
The tests should run successfully.
Run npx envinfo --preset jest
Paste the results here:
System:
OS: macOS 10.14.3
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 11.10.1 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
npmPackages:
jest: ^24.7.1 => 24.7.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Tests not working anymore after updating to version < 24.0.0
Today, we've updated to the newest version of jest in our TypeScript project. We've included jest in our package.json of our project with ......
Read more >Index of /archive/24.0.0/dev/ag-grid-community/dist/lib/style-tests
Index of /archive/24.0.0/dev/ag-grid-community/dist/lib/style-tests. Parent Directory · ag-theme-params.test.d.ts.
Read more >Changelog - Cypress Documentation
Sessions will no longer be stored if validation fails which will prevent a previously failed session from being restored in the next test....
Read more >Current Series Release Notes — tempest documentation
Add a new client to lists, creates, shows information for, and updates neutron log resource. Upgrade Notes¶. Tempest's identity service client ...
Read more >Fixed issues in Photoshop - Adobe Support
December 2022 (version 4.2) release. This month's update brings enhancements and fixes for some customer-reported issues. More like this.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

for me this is solved just by adding following line to file:
import '@types/jest';Installing
@types/jasminedid not work for me. @ljsimintt’s suggestion worked, though I eventually settled on pinningjestand@types/jestto24.0.0so I could stay on the same major version.