Skip to content

Commit 35492f3

Browse files
committed
Switch to nyc for code coverage
1 parent 39a0781 commit 35492f3

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
/test/custom-sassdoc
55
/sassdoc
66
/coverage
7+
.nyc_output
78
.DS_Store
89
npm-debug.log

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ sudo: false
1313
git:
1414
depth: 10
1515

16-
script: make travis
16+
script: make lint dist test cover
17+
after_success: make coveralls
1718

1819
notifications:
1920
slack:

Makefile

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
BIN = $(PWD)/node_modules/.bin/
22
SASSDOC = $(PWD)/bin/sassdoc
33

4-
all: dist lint test
4+
all: lint dist test
55

66
# Compile ES6 from `src` to ES5 in `dist`
77
# =======================================
@@ -28,19 +28,18 @@ test: test/data/expected.stream.json dist
2828
test/data/expected.stream.json: test/data/expected.json
2929
test/data/stream $< > $@
3030

31-
cover: dist
31+
cover:
3232
rm -rf coverage
33-
$(BIN)istanbul cover --report none --print detail $(BIN)_mocha test/**/*.test.js
33+
$(BIN)nyc $(BIN)mocha test/**/*.test.js
3434

3535
cover-browse: dist
3636
rm -rf coverage
37-
$(BIN)istanbul cover --report html $(BIN)_mocha test/**/*.test.js
38-
open coverage/index.html
37+
$(BIN)nyc --reporter=html $(BIN)mocha test/**/*.test.js
38+
$(BIN)opn coverage/index.html
39+
40+
coveralls:
41+
($(BIN)nyc report --reporter=text-lcov | $(BIN)coveralls) || exit 0
3942

40-
travis: lint cover
41-
$(BIN)istanbul report lcovonly
42-
(cat coverage/lcov.info | coveralls) || exit 0
43-
rm -rf coverage
4443

4544
# Development
4645
# ===========

package.json

+11-4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@
7373
"LICENCE.md",
7474
"README.md"
7575
],
76+
"scripts": {
77+
"test": "make"
78+
},
79+
"nyc": {
80+
"exclude": [
81+
"**/*.test.js",
82+
"test"
83+
]
84+
},
7685
"dependencies": {
7786
"babel-runtime": "^6.22.0",
7887
"chalk": "^1.0.0",
@@ -106,13 +115,11 @@
106115
"coveralls": "^2.11.2",
107116
"dateformat": "^1.0.11",
108117
"eslint": "^0.18.0",
109-
"istanbul": "^0.3.13",
110118
"jsesc": "^0.5.0",
111119
"mocha": "^2.2.1",
120+
"nyc": "^10.1.2",
121+
"opn-cli": "^3.1.0",
112122
"sinon": "^1.14.1",
113123
"vinyl": "^0.4.6"
114-
},
115-
"scripts": {
116-
"test": "make dist lint test"
117124
}
118125
}

0 commit comments

Comments
 (0)