Here is my
- npm install -g npm
- npm run verify
- npm install coveralls && npm run coveralls
And here is my
"coverage": "npm test && nyc check-coverage --branches 85 --functions 85 --lines 85",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"test": "npm run clean && tsc && nyc ava"
When it comes to
package.json looks just fine, it’s more to do with your
.travis.yml config when I look at it all in aggregate.
I just made this repository today, you’d find it of great use probably: GitHub - Montana/travis-nyc: Travis w/ nyc by Montana Mendy.
.travis.yml I coded out is more instructional and declarative based, for example:
- npm init --yes
- npm i express mocha chai supertest nyc mongoose
- sudo apt-get install gnupg
- wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
- sudo apt-get install -y mongodb-org
- sudo systemctl start mongod
- node bin/www &
- npm install -g nyc
- nyc --version
- nyc npm run test
node bin/www &, and you can see where I fetched
nyc, etc. This worked out perfectly for me. This doesn’t cover
coveralls I understand, but same implementation of
coveralls would apply. Get the environment variables from
coveralls add them in Travis, and you’d have more code coverage.
For one of my projects using
coveralls this is a snippet of my
travis.yml that maybe can help you:
- script: COVERALLS_FLAG_NAME=test-1 make test-coveralls-1
- script: COVERALLS_FLAG_NAME=test-2 make test-coveralls-2
- script: npm install coveralls nyc --save-dev
after_success: npm run coverage
This is a private repo so I can only give you this snippet but should point you in the right direction.
thank you so much @montana! this worked perfectly