Skip to content

Commit

Permalink
Report coverage on untransformed main files
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Jul 7, 2015
1 parent 703322d commit 7d27c7a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/generate-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ set -o errexit
set -x

# Instrument the source code with Istanbul's __coverage__ variable.
# We clear out everything to ensure a hermetic run.
rm -rf coverage/*
rm -rf coverage/* # Clear out everything to ensure a hermetic run.
istanbul instrument --output coverage/main dist/main
istanbul instrument --output coverage/test dist/test
cp -r dist/test coverage/test # test code needn't be covered

# Build a combined file for running the tests in-browser
browserify coverage/**/*.js -o coverage/tests.js
Expand All @@ -32,3 +31,6 @@ phantomjs \

# Convert the JSON coverage to LCOV for coveralls.
istanbul report --include coverage/*.json lcovonly

# Monkey patch in the untransformed source paths.
perl -i -pe 's,dist/main,src/main,' coverage/lcov.info

0 comments on commit 7d27c7a

Please sign in to comment.