所以,當我在本地運行我的回購它工作得很好,但是當我推一個承諾,它運行在特拉維斯CI我不斷收到此錯誤裏面的摩卡測試權限:特拉維斯CI的NodeJS建立在本地運行,但得到的特拉維斯CI否認
sh: 1: mocha: Permission denied
npm ERR! Test failed. See above for more details.
我.travis.yml
language: node_js
node_js:
- "6"
install:
-npm install
before_script: npm install -g mocha
before_script: chmod 0777 ./node_modules/.bin/mocha
的package.json
{
"name": "skeletonapp",
"version": "0.0.0",
"description": "skeletonapp",
"main": "index.js",
"author": {
"name": "li"
},
"scripts": {
"test": "mocha"
},
"dependencies": {
"chai": "^3.5.0",
"mocha": "^3.1.2"
}
}
文件的結構
https://travis-ci.org/LiamDotPro/Travis-CI-NodeJS-Skeleton---Mocha-Chai/builds/173340318
test.js
var assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal(-1, [1, 2, 3].indexOf(4));
});
});
});
我其實不能感謝你足夠抽空答覆我的問題的時候,被這個爭奪年齡。你是最好的! –
很高興聽到它爲你工作! – banzaiman