admin管理员组文章数量:1417037
I have a Node.js project as a GitHub repo. There are currently no tests written for the project. My goal is to simply build the project successfully with Travis-CI, without any tests.
I'm currently using the following basic Travis config, .travis.yml
:
language: node_js
node_js:
- "node"
install:
- npm install
The above will fail for me, with the following output:
[0Ktravis_fold:end:nvm.install
[0K$ node --version
v9.11.1
$ npm --version
5.6.0
$ nvm --version
0.33.8
travis_fold:start:install
[0Ktravis_time:start:154792e9
[0K$ npm install
[37;40mnpm[0m [0m[30;43mWARN[0m[35m[0m [email protected] No repository field.
[0m
up to date in 0.599s
[0Ktravis_fold:end:install
[0Ktravis_time:start:3e0b4d3c
[0K$ npm test
> [email protected] test /home/travis/build/githubHandle/repoName.js
> echo "Error: no test specified" && exit 1
Error: no test specified
[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m Test failed. See above for more details.
[0m
I don't understand why npm test
is being run. It appears to be failing, as no tests have been written. How could I build/install on Travis without checking for tests?
I have a Node.js project as a GitHub repo. There are currently no tests written for the project. My goal is to simply build the project successfully with Travis-CI, without any tests.
I'm currently using the following basic Travis config, .travis.yml
:
language: node_js
node_js:
- "node"
install:
- npm install
The above will fail for me, with the following output:
[0Ktravis_fold:end:nvm.install
[0K$ node --version
v9.11.1
$ npm --version
5.6.0
$ nvm --version
0.33.8
travis_fold:start:install
[0Ktravis_time:start:154792e9
[0K$ npm install
[37;40mnpm[0m [0m[30;43mWARN[0m[35m[0m [email protected] No repository field.
[0m
up to date in 0.599s
[0Ktravis_fold:end:install
[0Ktravis_time:start:3e0b4d3c
[0K$ npm test
> [email protected] test /home/travis/build/githubHandle/repoName.js
> echo "Error: no test specified" && exit 1
Error: no test specified
[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m Test failed. See above for more details.
[0m
I don't understand why npm test
is being run. It appears to be failing, as no tests have been written. How could I build/install on Travis without checking for tests?
-
1
Because that's the default, per the docs. Also
npm install
is the default install step, so you can remove that. You can skip a step by just giving the value oftrue
for it, also per the docs. Read the docs! Alternatively change yourscripts
fortest
in thepackage.json
to notexit 1
. – jonrsharpe Commented Apr 16, 2018 at 15:38 -
1
@jonrsharpe Thanks for the help. I'm sorry, I didn't understand how to disable
npm test
in the documentation. – ShanZhengYang Commented Apr 16, 2018 at 15:55
1 Answer
Reset to default 7npm test
is the default build script for nodejs projects.
If you haven't unit tests or build task, you can skip this step. To do that, add the following line in your travis config file:
script: 'true'
本文标签: javascriptHow to configure Travis CI to build Nodejs without testsStack Overflow
版权声明:本文标题:javascript - How to configure Travis CI to build Node.js without tests? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745261703a2650383.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论