Skip to content

Commit

Permalink
[Tests] switch to nyc for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 14, 2019
1 parent 2694da4 commit 12f324a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extension": [
".js",
".jsx"
],
"include": [
"*",
"packages/*/*",
"packages/*/src"
],
"exclude": [
"packages/enzyme-test-suite",
"_book",
"coverage",
"packages/*/node_modules"
],
"require": [
"babel-register"
],
"reporter": [
"text",
"html",
"lcov"
],
"all": false,
"check-coverage": false,
"statements": 100,
"branches": 100,
"lines": 100,
"functions": 100,
"sourceMap": true,
"instrument": true
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before_script:
script:
- 'if [ -n "${LINT-}" ]; then npm run lint; elif [ -n "${KARMA-}" ]; then npm run test:karma -- --single-run; elif [ -n "${REACT-}" ]; then npm run travis; else false ; fi'
after_script:
- 'if [ "${TRAVIS_NODE_VERSION}" = "4" ] || [ "${TRAVIS_NODE_VERSION}" = "0.12" ]; then cat ./coverage/lcov.info | ./node_modules/.bin/coveralls ; fi'
- 'if [ -n "${REACT-}" ]; then case "${TRAVIS_NODE_VERSION}" in "10" | "4" | "0.12") cat ./coverage/lcov.info | ./node_modules/.bin/coveralls ;; esac ; fi'
sudo: false
matrix:
fast_finish: true
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"docs:watch": "npm run docs:prepare && gitbook serve",
"docs:publish": "npm run docs:clean && npm run docs:build && cd _book && git init && git commit --allow-empty -m 'update book' && git fetch git@github.com:airbnb/enzyme.git gh-pages && git checkout -b gh-pages && git add . && git commit -am 'update book' && git push git@github.com:airbnb/enzyme.git gh-pages --force",
"pretravis": "npm run build",
"travis": "babel-node \"$(which istanbul)\" cover --report html _mocha -- packages/enzyme-test-suite/test --recursive",
"travis": "nyc mocha --recursive packages/enzyme-test-suite/test",
"since": "node since"
},
"repository": {
Expand Down Expand Up @@ -83,8 +83,6 @@
"gitbook-plugin-github": "^2.0.0",
"glob-gitignore": "^1.0.11",
"in-publish": "^2.0.0",
"istanbul": "^1.0.0-alpha.2",
"istanbul-api": "^1.3.7",
"json-loader": "^0.5.7",
"karma": "^1.3.0",
"karma-chrome-launcher": "^1.0.1",
Expand All @@ -94,6 +92,8 @@
"karma-webpack": "^1.8.1",
"lerna": "^2.11.0",
"mocha": "^3.5.3",
"mocha-lcov-reporter": "^1.3.0",
"nyc": "^10.3.2",
"prop-types": "^15.7.2",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2",
Expand Down

0 comments on commit 12f324a

Please sign in to comment.