Skip to content

Commit 934d6ba

Browse files
committed
build: use nyc for test coverage
1 parent d39069d commit 934d6ba

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.github/workflows/ci.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -36,43 +36,43 @@ jobs:
3636
- name: Node.js 0.8
3737
node-version: "0.8"
3838
39-
npm-rm: istanbul
39+
npm-rm: nyc
4040

4141
- name: Node.js 0.10
4242
node-version: "0.10"
43-
43+
4444

4545
- name: Node.js 0.12
4646
node-version: "0.12"
47-
47+
4848

4949
- name: io.js 1.x
5050
node-version: "1.8"
51-
51+
5252

5353
- name: io.js 2.x
5454
node-version: "2.5"
55-
55+
5656

5757
- name: io.js 3.x
5858
node-version: "3.3"
59-
59+
6060

6161
- name: Node.js 4.x
6262
node-version: "4.9"
63-
63+
6464

6565
- name: Node.js 5.x
6666
node-version: "5.12"
67-
67+
6868

6969
- name: Node.js 6.x
7070
node-version: "6.16"
71-
71+
7272

7373
- name: Node.js 7.x
7474
node-version: "7.10"
75-
75+
7676

7777
- name: Node.js 8.x
7878
node-version: "8.16"
@@ -164,7 +164,7 @@ jobs:
164164
- name: Run tests
165165
shell: bash
166166
run: |
167-
if npm -ps ls istanbul | grep -q istanbul; then
167+
if npm -ps ls nyc | grep -q nyc; then
168168
npm run test-ci
169169
cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
170170
else
@@ -176,7 +176,7 @@ jobs:
176176
run: npm run lint
177177

178178
- name: Collect code coverage
179-
if: steps.list_env.outputs.istanbul != ''
179+
if: steps.list_env.outputs.nyc != ''
180180
run: |
181181
if [[ -d ./coverage ]]; then
182182
mv ./coverage "./${{ matrix.name }}"
@@ -186,7 +186,7 @@ jobs:
186186
187187
- name: Upload code coverage
188188
uses: actions/upload-artifact@v3
189-
if: steps.list_env.outputs.istanbul != ''
189+
if: steps.list_env.outputs.nyc != ''
190190
with:
191191
name: coverage
192192
path: ./coverage

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.nyc_output/
12
coverage/
23
node_modules/
34
npm-debug.log

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"eslint-plugin-node": "11.1.0",
1717
"eslint-plugin-promise": "6.1.1",
1818
"eslint-plugin-standard": "4.1.0",
19-
"istanbul": "0.4.5",
2019
"mocha": "9.2.2",
20+
"nyc": "15.1.0",
2121
"supertest": "6.3.3"
2222
},
2323
"files": [
@@ -31,7 +31,7 @@
3131
"scripts": {
3232
"lint": "eslint .",
3333
"test": "mocha --reporter spec --bail --check-leaks test/",
34-
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
35-
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
34+
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
35+
"test-cov": "nyc --reporter=html --reporter=text npm test"
3636
}
3737
}

0 commit comments

Comments
 (0)