创建反应应用程序:配置 Jest:运行所有测试文件

kul*_*lls 3 reactjs jestjs enzyme

我想npm test在我的服务器中进行配置。当我运行时npm test,它调用react-scripts test触发提示窗口(附加屏幕)。如何避免提示并在服务器中运行所有测试用例。

"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"lint": "./node_modules/.bin/eslint ."
},
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

小智 18

要运行所有测试,请使用 "test": "react-scripts test --watchAll=false"


小智 2

当你想运行所有测试时,你可以使用npm test --watchAll