我正在使用create-react-app,我的开发webpack服务器运行在https中。因此,当运行npm run cypress:open时,我期望:
- 我的应用程序在https://localhost:3000上运行
- 一旦服务器启动,cypress启动器就在其上运行。
只有第一步发生了,cypress启动器没有打开。
这是我的package.json文件中的scripts配置:
"scripts": {
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
"start-js": "export HTTPS=true&&react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"cy:open": "cypress open",
"cypress:open": "start-server-and-test start http-get://localhost:3000 cy:open"
}
我只在https时遇到了这个问题,而不是http。