Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Commit

Permalink
Count Babel tests towards Babylon code coverage (#182)
Browse files Browse the repository at this point in the history
* Add code coverage from Babel tests

* Configure nyc correctly for Babel test coverage

* Guard against nyc config conflicts if Babel switches to nyc in the future

* Move .nyc_output from Babel build dir to root
  • Loading branch information
motiz88 authored and danez committed Nov 9, 2016
1 parent e260381 commit 6cb0235
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ matrix:
- node_js: "node"
env: BABEL=true

after_success: 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${BABEL-}" ]; then npm run coverage ; fi'
after_success: 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ]; then npm run coverage ; fi'

notifications:
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ bootstrap-babel: clean
find ./build/babel/packages -type d -name 'babylon' -prune -exec rm -rf '{}' \; -exec ln -s '../../../../../' '{}' \;

test-babel:
npm run build
BABEL_ENV=test npm run build
# in case babel ever switches to nyc: filter its config out of package.json
cd ./build/babel; \
make test-only

jq "del(.nyc)" package.json > package.nonyc.json; \
mv -f package.nonyc.json package.json; \
../../node_modules/.bin/nyc --no-instrument --no-source-map --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts; \
mv .nyc_output ../../.nyc_output

0 comments on commit 6cb0235

Please sign in to comment.