Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 在CreateReact应用程序上与Travis一起运行木偶师测试_Reactjs_Travis Ci_Puppeteer - Fatal编程技术网

Reactjs 在CreateReact应用程序上与Travis一起运行木偶师测试

Reactjs 在CreateReact应用程序上与Travis一起运行木偶师测试,reactjs,travis-ci,puppeteer,Reactjs,Travis Ci,Puppeteer,Puppeter需要一台正在运行的服务器才能运行测试。如何在travis中同时启动npm和npm测试 我的,特拉维斯,yml是 language: node_js node_js: - "8" cache: directories: - "node_modules" install: - npm install script: - npm start - npm test 生成失败,并显示命令“npm start”以1退出。您需要在-npm start和s

Puppeter需要一台正在运行的服务器才能运行测试。如何在travis中同时启动npm和npm测试

我的,特拉维斯,yml是

language: node_js
node_js:
  - "8"

cache:  
  directories:
    - "node_modules"

install:
  - npm install

script:
  - npm start
  - npm test

生成失败,并显示命令“npm start”以1退出。

您需要在-npm start和sleep之后添加此“&”符号。 下面是一个例子:

script:
  - npm run start &
  - sleep 15
  - npm run test
此外,如果您需要在无头模式下查看false添加:

addons:
  chrome: stable

另外,我希望这将帮助您

不要在travis上使用
npm start
。您可以在全局配置/拆卸中启动express server。请看一个例子