现在构建一个由create-react-app
.
在我的package.json
中,我安装了一些依赖项。完整列表在这里:
包.json
{
"name": "app",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"dependencies": {
"jest-cli": "^22.4.3",
"raven-js": "^3.25.1",
"react": "^16.3.2",
"react-raven": "^1.2.3",
"react-scripts": "1.1.4",
"babel-plugin-add-module-exports": "0.2.1"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-jest": "^22.4.3",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-react-app": "^3.1.1",
"coveralls": "^3.0.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"jest": "^22.4.3",
"react-addons-test-utils": "^15.6.2",
"react-dom": "^16.3.2",
"react-test-renderer": "^16.3.2"
}
}
还创建了一个.travis.yml
文件。想在 TravisCI 上测试代码:
.travis.yml
language: node_js
node_js:
- "8"
before_script:
- npm install
- npm install coveralls
script:
- jest --coverage --coverageReporters=text-lcov | coveralls
但是当 TravisCI 运行任务时,它的控制台日志显示:
...
$ jest --coverage --coverageReporters=text-lcov | coveralls
PASS src/sum.test.js
✓ adds 1 + 2 to equal 3 (7ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.629s
Ran all test suites.
/home/travis/build/[MY_GITHUB]/[MY_PROJECT]/node_modules/coveralls/bin/coveralls.js:18
throw err;
^
Bad response: 500 {"message":"Build processing error.","error":true,"url":""}
The command "jest --coverage --coverageReporters=text-lcov | coveralls" exited with 1.
Done. Your build exited with 1.
为什么不能将覆盖结果发送到工作服?