我无法测试使用 create-react-app 创建的应用程序。
所有指南都说测试默认工作,但当我尝试“yarn test”时,它需要安装“jest-cli”,安装后出现错误:
TypeError: environment.teardown is not a function
最佳答案
您不需要自己安装 jest-cli。它应该开箱即用。
尝试以下操作:
- 删除 package-lock.json、yarn.lock 和 node_modules
- 从 package.json 的依赖中移除 jest
- 然后执行
npm install
或yarn install
。
关于javascript - 如何解决TypeError : environment. teardown is not a function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50696201/