TypeError: environment.teardown is not a function at node_modules/jest-runner/build/run_test.js
See original GitHub issue🐛 Bug Report
Hello, I have used create React app and can’t make the tests work. Initially, I got an error message with jest and jest-cli so installed jest with npm install --save-dev jest and then jest-cli with npm install jest-cli. However, I still get the following message: Test suite failed to run TypeError: environment.teardown is not a function at node_modules/jest-runner/build/run_test.js
Run npx envinfo --preset jest
Paste the results here: System: OS: macOS High Sierra 10.13.2 CPU: x64 Intel® Core™ i5-5350U CPU @ 1.80GHz Binaries: Node: 9.4.0 - ~/.nvm/versions/node/v9.4.0/bin/node Yarn: 1.6.0 - /usr/local/bin/yarn npm: 6.1.0 - ~/.nvm/versions/node/v9.4.0/bin/npm npmPackages: jest: ^23.1.0 => 23.1.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:44
Top Results From Across the Web
How to solve TypeError: environment.teardown is not a function
TypeError : environment.teardown is not a function. Because I was trying to upgrade Jest to the latest version. When starting an app with ......
Read more >How to solve TypeError: environment.teardown is not a ...
TypeError : environment.teardown is not a function. Because I was trying to upgrade Jest to the latest version. When starting an app with...
Read more >Troubleshooting Jest with React: environment.setup is not a ...
This error affected two things: Jest test runs failed with the error TypeError: environment.setup is not a function . Travis CI passed despite ......
Read more >How to solve TypeError: environment.teardown is ... - Newbedev
How to solve TypeError: environment.teardown is not a function. You shouldn't need to install jest-cli yourself. It should come out of the box....
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 FreeTop 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
Top GitHub Comments
I managed to make it work after deleting package-lock.json, yarn.lock, node_modules, removing jest from the dependencies in package.json, then doing npm install and yarn install!
Before I could run the tests though the script was complaining that it was missing the jest-cli.
I installed that, then got this error.