question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:44

github_iconTop GitHub Comments

135reactions
FaabLondoncommented, Jun 5, 2018

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!

31reactions
yoryoscommented, Jun 5, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found