I’m setting up my server side for NodeJS application which I’m integrating with Travis. I’m using Mocha and NYC with Palo Alto Networks to help with my tests. However, while these tests run fine locally, this is what occurs within Travis:
> server@1.0.0 test /server
> nyc --reporter=lcov npm run run-test "--coverage"
sh: nyc: Permission denied
npm ERR! Test failed. See above for more details.
The command "docker run repname/server npm test -- --coverage" exited with 1.
That’s my .travis.yml file:
sudo: required
services:
- docker
before_install:
- docker build -t repname/server -f Dockerfile.dev .
script:
- docker run repname/server npm test -- --coverage
I even tried some of other similar problems find on stack: Thats what I tried with no luck:
For NYC:
before_script: chmod 0555 ./node_modules/.bin/nyc
before_script: chmod 0777 ./node_modules/.bin/nyc
For Mocha:
before_script: chmod 0555 ./node_modules/.bin/mocha
before_script: chmod 0555 ./node_modules/.bin/mocha
thanks for any help!