Skip to content

Commit

Permalink
test: Separate TravisCI coverage script from local coverage script
Browse files Browse the repository at this point in the history
  • Loading branch information
q2s2t committed Oct 13, 2018
1 parent daf66cf commit 9cadde4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ node_js:
- "node"

script:
- npm run coverage
- npm run coverage-travis

after_script:

Expand All @@ -28,3 +28,5 @@ after_script:

# Send coverage to Code Climate
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

- rm -rf ./coverage
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"description": "A Node.js wrapper for 7-Zip with platform binaries",
"main": "lib/index.js",
"scripts": {
"test": "npx mocha -r esm 'test/**/*.spec.js' --timeout=0",
"coverage": "npx nyc --reporter=html --reporter=lcov npm test",
"test": "npx mocha -r esm --reporter=spec 'test/**/*.spec.js'",
"coverage-local": "npx nyc --reporter=html --reporter=lcov npm test",
"coverage-travis": "npx --reporter=lcovonly npm test",
"coveralls": "cat ./coverage/lcov.info | npx coveralls"
},
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion test/func/add.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global describe, it, before, beforeEach, after, afterEach */
/* global describe, it, before, after */
import { expect } from 'chai'
import { existsSync, statSync } from 'fs'
import { sync as rimraf } from 'rimraf'
Expand All @@ -11,6 +11,7 @@ const tmpDir = './test/_tmp'
describe('Functional: add()', function () {
before(function (done) {
rimraf('*/**/.DS_Store')
rimraf(`${tmpDir}/*`)
done()
})

Expand Down

0 comments on commit 9cadde4

Please sign in to comment.