Skip to content

Commit dafa811

Browse files
committed
build: use nyc for coverage testing
1 parent d80cf11 commit dafa811

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,43 +34,43 @@ jobs:
3434
- name: Node.js 0.8
3535
node-version: "0.8"
3636
npm-i: mocha@2.5.3 supertest@1.1.0
37-
npm-rm: istanbul
37+
npm-rm: nyc
3838

3939
- name: Node.js 0.10
4040
node-version: "0.10"
41-
npm-i: mocha@3.5.3 supertest@2.0.0
41+
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
4242

4343
- name: Node.js 0.12
4444
node-version: "0.12"
45-
npm-i: mocha@3.5.3 supertest@2.0.0
45+
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
4646

4747
- name: io.js 1.x
4848
node-version: "1.8"
49-
npm-i: mocha@3.5.3 supertest@2.0.0
49+
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
5050

5151
- name: io.js 2.x
5252
node-version: "2.5"
53-
npm-i: mocha@3.5.3 supertest@2.0.0
53+
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
5454

5555
- name: io.js 3.x
5656
node-version: "3.3"
57-
npm-i: mocha@3.5.3 supertest@2.0.0
57+
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
5858

5959
- name: Node.js 4.x
6060
node-version: "4.9"
61-
npm-i: mocha@5.2.0 supertest@3.4.2
61+
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2
6262

6363
- name: Node.js 5.x
6464
node-version: "5.12"
65-
npm-i: mocha@5.2.0 supertest@3.4.2
65+
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2
6666

6767
- name: Node.js 6.x
6868
node-version: "6.17"
69-
npm-i: mocha@6.2.2
69+
npm-i: mocha@6.2.2 nyc@14.1.1
7070

7171
- name: Node.js 7.x
7272
node-version: "7.10"
73-
npm-i: mocha@6.2.2
73+
npm-i: mocha@6.2.2 nyc@14.1.1
7474

7575
- name: Node.js 8.x
7676
node-version: "8.17"
@@ -154,7 +154,7 @@ jobs:
154154
- name: Run tests
155155
shell: bash
156156
run: |
157-
if npm -ps ls istanbul | grep -q istanbul; then
157+
if npm -ps ls nyc | grep -q nyc; then
158158
npm run test-ci
159159
else
160160
npm test
@@ -166,7 +166,7 @@ jobs:
166166

167167
- name: Collect code coverage
168168
uses: coverallsapp/github-action@master
169-
if: steps.list_env.outputs.istanbul != ''
169+
if: steps.list_env.outputs.nyc != ''
170170
with:
171171
github-token: ${{ secrets.GITHUB_TOKEN }}
172172
flag-name: run-${{ matrix.test_number }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.nyc_output
12
coverage
23
node_modules
34
package-lock.json

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"eslint-plugin-node": "11.1.0",
2525
"eslint-plugin-promise": "4.3.1",
2626
"eslint-plugin-standard": "4.0.1",
27-
"istanbul": "0.4.5",
2827
"mocha": "8.4.0",
28+
"nyc": "15.1.0",
2929
"supertest": "6.1.6"
3030
},
3131
"files": [
@@ -39,7 +39,7 @@
3939
"scripts": {
4040
"lint": "eslint .",
4141
"test": "mocha --reporter spec --bail --check-leaks test/",
42-
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
43-
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
42+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
43+
"test-cov": "nyc --reporter=html --reporter=text npm test"
4444
}
4545
}

0 commit comments

Comments
 (0)