I'm setting up a simple NodeJS application which I'm integrating with Travis-CI. I'm using Mocha to help with my tests. However, while these tests run fine locally, I'm failing the tests when on Travis-CI before deploying to Openshift. Some help on figuring this out would be cool =)
Travis-CI output
[email protected] test /home/travis/build/melvrickgoh/CAT
> mocha test/
sh: 1: mocha: Permission denied
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
This is what is have inside my package.json
"scripts": {
"start": "node app.js --websocket-port=$OPENSHIFT_NODEJS_PORT --log-level=1",
"test": "mocha test/ "
},
Same issue, adding this to my .travis.yml
this fixed it for me:
before_script: chmod 0777 ./node_modules/.bin/mocha
Had same issue on OpenShift when trying to run tests. Solved by making the the mocha file executable, as follows:
chmod 0777 /var/lib/openshift/53ef9c315973cabb00034c/app-root/runtime/repo/node_modules/.bin/mocha
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With