【发布时间】:2019-04-23 12:23:29
【问题描述】:
我正在使用 create-react-app 来构建我的应用程序,并且我正在使用 cypress 来实现自动化。
"scripts": {
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"cy:run": "cypress run ,
"cypress:all": "start-server-and-test start http-get://localhost:3000 cy:run"
}
为了运行测试,首先我需要使用npm start 启动我的应用程序,然后我可以运行命令npm run cy:run -- --record --key <record-key>。
我正在做的是运行命令npm run cypress:all,它将调用npm start,一旦服务器启动并运行,它就会在其上运行测试。
但是我如何传递这个命令的记录标志呢? npm run cypress:all -- --record <record-key> 在这里不起作用。
【问题讨论】:
标签: node.js npm cypress npm-scripts create-react-native-app