Skip to content

Commit 4647313

Browse files
committed
Migrate from istanbul to nyc 🎉
Better ES6 support, because that seems to be necessary now.
1 parent e3114dc commit 4647313

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

coverage.sh

+9-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export PATH="$(pwd):$PATH"
3838

3939
# if we don't have our npm dependencies available, build node and fetch them
4040
# with npm
41-
if [ ! -x "$SRCDIR/node_modules/.bin/istanbul" ] || \
41+
if [ ! -x "$SRCDIR/node_modules/.bin/nyc" ] || \
4242
[ ! -x "$SRCDIR/node_modules/.bin/istanbul-merge" ]; then
4343
echo "Building, without lib/ coverage..." >&2
4444
./configure
@@ -47,17 +47,17 @@ if [ ! -x "$SRCDIR/node_modules/.bin/istanbul" ] || \
4747

4848
cd "$SRCDIR"
4949

50-
# get istanbul
51-
node "$WORKDIR/node/deps/npm" install
50+
# get nyc + istanbul-merge
51+
./node "$WORKDIR/node/deps/npm" install
5252

53-
test -x "$SRCDIR/node_modules/.bin/istanbul"
53+
test -x "$SRCDIR/node_modules/.bin/nyc"
5454
test -x "$SRCDIR/node_modules/.bin/istanbul-merge"
5555
fi
5656

5757
cd "$WORKDIR/node"
5858

5959
echo "Instrumenting code in lib/..." >&2
60-
"$SRCDIR/node_modules/.bin/istanbul" instrument lib/ -o lib_/
60+
"$SRCDIR/node_modules/.bin/nyc" instrument lib/ lib_/
6161
sed -e s~"'"lib/~"'"lib_/~g -i~ node.gyp
6262

6363
echo "Removing old coverage files" >&2
@@ -77,10 +77,11 @@ python tools/test.py --mode=release -J \
7777
addons doctool known_issues pseudo-tty parallel sequential
7878

7979
echo "Gathering coverage..." >&2
80-
mkdir -p coverage
81-
"$SRCDIR/node_modules/.bin/istanbul-merge" --out coverage/libcov.json \
80+
mkdir -p coverage .cov_tmp
81+
"$SRCDIR/node_modules/.bin/istanbul-merge" --out .cov_tmp/libcov.json \
8282
'out/Release/.coverage/coverage-*.json'
83-
"$SRCDIR/node_modules/.bin/istanbul" report --include coverage/libcov.json html
83+
(cd lib && "$SRCDIR/node_modules/.bin/nyc" report \
84+
--temp-directory "$(pwd)/../.cov_tmp" -r html --report-dir "../coverage")
8485
(cd out && "$WORKDIR/gcovr/scripts/gcovr" --gcov-exclude='.*deps' --gcov-exclude='.*usr' -v \
8586
-r Release/obj.target/node --html --html-detail \
8687
-o ../coverage/cxxcoverage.html)

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"url": "https://github.com/addaleax/node-core-coverage/issues"
88
},
99
"dependencies": {
10-
"istanbul": "^0.4.3",
11-
"istanbul-merge": "^1.1.0"
10+
"istanbul-merge": "^1.1.0",
11+
"nyc": "^7.1.0"
1212
},
1313
"homepage": "https://github.com/addaleax/node-core-coverage#readme",
1414
"license": "MIT",

0 commit comments

Comments
 (0)