Skip to content

Commit 20df3ec

Browse files
committed
replace mocha and nyc with native node test runner and c8
1 parent 3ea88a3 commit 20df3ec

File tree

3 files changed

+157
-165
lines changed

3 files changed

+157
-165
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,14 @@ jobs:
7070
7171
- name: Run tests
7272
shell: bash
73-
run: |
74-
if npm -ps ls nyc | grep -q nyc; then
75-
npm run test-ci
76-
else
77-
npm test
78-
fi
73+
run: npm run test-ci
7974

8075
- name: Lint code
8176
if: steps.list_env.outputs.eslint != ''
8277
run: npm run lint
8378

8479
- name: Collect code coverage
8580
uses: coverallsapp/github-action@master
86-
if: steps.list_env.outputs.nyc != ''
8781
with:
8882
github-token: ${{ secrets.GITHUB_TOKEN }}
8983
flag-name: run-${{ matrix.test_number }}

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@
1212
],
1313
"repository": "jshttp/content-disposition",
1414
"devDependencies": {
15-
"deep-equal": "1.0.1",
15+
"c8": "^10.1.2",
1616
"eslint": "7.32.0",
1717
"eslint-config-standard": "13.0.1",
1818
"eslint-plugin-import": "2.25.3",
1919
"eslint-plugin-markdown": "2.2.1",
2020
"eslint-plugin-node": "11.1.0",
2121
"eslint-plugin-promise": "5.2.0",
22-
"eslint-plugin-standard": "4.1.0",
23-
"mocha": "^9.2.2",
24-
"nyc": "15.1.0"
22+
"eslint-plugin-standard": "4.1.0"
2523
},
2624
"files": [
2725
"LICENSE",
@@ -34,8 +32,8 @@
3432
},
3533
"scripts": {
3634
"lint": "eslint .",
37-
"test": "mocha --reporter spec --bail --check-leaks test/",
38-
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
39-
"test-cov": "nyc --reporter=html --reporter=text npm test"
35+
"test": "node --test --test-reporter spec",
36+
"test-ci": "c8 --reporter=lcovonly --reporter=text npm test",
37+
"test-cov": "c8 --reporter=html --reporter=text npm test"
4038
}
4139
}

0 commit comments

Comments
 (0)