Skip to content

Commit

Permalink
replace mocha and nyc with native node test runner and c8
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip9587 committed Oct 22, 2024
1 parent 3ea88a3 commit 20df3ec
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 165 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,14 @@ jobs:
- name: Run tests
shell: bash
run: |
if npm -ps ls nyc | grep -q nyc; then
npm run test-ci
else
npm test
fi
run: npm run test-ci

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

- name: Collect code coverage
uses: coverallsapp/github-action@master
if: steps.list_env.outputs.nyc != ''
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.test_number }}
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
],
"repository": "jshttp/content-disposition",
"devDependencies": {
"deep-equal": "1.0.1",
"c8": "^10.1.2",
"eslint": "7.32.0",
"eslint-config-standard": "13.0.1",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0",
"mocha": "^9.2.2",
"nyc": "15.1.0"
"eslint-plugin-standard": "4.1.0"
},
"files": [
"LICENSE",
Expand All @@ -34,8 +32,8 @@
},
"scripts": {
"lint": "eslint .",
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test"
"test": "node --test --test-reporter spec",
"test-ci": "c8 --reporter=lcovonly --reporter=text npm test",
"test-cov": "c8 --reporter=html --reporter=text npm test"
}
}
Loading

0 comments on commit 20df3ec

Please sign in to comment.