如何解决TypeError:environment.teardown不是函数? [英] How to solve TypeError: environment.teardown is not a function?
本文介绍了如何解决TypeError:environment.teardown不是函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法测试使用create-react-app创建的应用程序,所有指南均表示该测试默认情况下有效,但是当我尝试纱线测试"时,它要求安装"jest-cli",并且安装后出现错误"TypeError :environment.teardown不是函数".
i cant test application which created with create-react-app, all guides says that test is working by default, but when i try "yarn test" it requires install 'jest-cli' and after installation gives an error "TypeError: environment.teardown is not a function".
推荐答案
您不需要自己安装jest-cli,它应该是开箱即用的.
You shouldn't need to install jest-cli yourself, it should come out of the box.
请尝试以下操作:
- 删除package-lock.json,yarn.lock和node_modules
- 从package.json中的依赖项中删除笑话
- 然后执行
npm install
或yarn install
.
- Delete package-lock.json, yarn.lock and node_modules
- Remove jest from the dependencies in package.json
- Then do
npm install
oryarn install
.
这篇关于如何解决TypeError:environment.teardown不是函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文