Skip to content

Commit

Permalink
feat: switch from nyc to c8 for native V8 coverage
Browse files Browse the repository at this point in the history
Node.js supports writing coverage files since v10.12.  Use c8 to manage
creation and reporting of coverage information as nyc did for istanbul.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
  • Loading branch information
kevinoid committed Apr 19, 2021
1 parent dc390ae commit d72a313
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Project Template
A Node.js/npm project template with [codecov](https://codecov.io/),
[coveralls](https://coveralls.io/), [ESLint](https://eslint.org/),
[conventional-changelog](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli),
[nyc](https://github.com/istanbuljs/nyc), [JSDoc](http://usejsdoc.org/), and
[c8](https://github.com/bcoe/c8), [JSDoc](http://usejsdoc.org/), and
[mocha](https://mochajs.org/).

It is the template that I am using for my own Node.js projects, which
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kevinoid/project-template",
"version": "0.0.1",
"description": "A Node.js/npm project template with codecov, coveralls, ESLint, conventional-changelog, nyc, JSDoc, and mocha.",
"description": "A Node.js/npm project template with codecov, coveralls, ESLint, conventional-changelog, c8, JSDoc, and mocha.",
"keywords": [
"project-template",
"template"
Expand Down Expand Up @@ -40,12 +40,12 @@
"lint-js": "eslint --report-unused-disable-directives . && echo ESLint passed.",
"postpublish": "git -C doc push && git push --follow-tags origin master gh-pages && echo Remember to update GitHub Releases from CHANGELOG.md",
"postversion": "rimraf doc && git clone -b gh-pages -l -q . doc && npm run doc && git -C doc add . && git -C doc commit -n -m \"Docs for v$npm_package_version\"",
"preversion": "npm run test-cov && nyc check-coverage --statements 95 && depcheck --ignore-dirs doc && david && git-branch-is master && hub-ci-status -vv --wait",
"preversion": "npm run test-cov && c8 check-coverage --statements 95 && depcheck --ignore-dirs doc && david && git-branch-is master && hub-ci-status -vv --wait",
"start": "supervisor --quiet --no-restart-on exit --extensions js,json --ignore test --poll-interval 2000 server.js",
"test": "npm run lint && npm run test-unit",
"test-cov": "npm run lint && npm run test-unit-cov",
"test-unit": "node --throw-deprecation --unhandled-rejections=strict node_modules/mocha/bin/mocha --parallel --recursive test",
"test-unit-cov": "nyc --reporter=lcov --reporter=text npm run test-unit",
"test-unit-cov": "c8 --reporter=lcov --reporter=text npm run test-unit",
"upload-cov": "codecov < ./coverage/lcov.info && coveralls < ./coverage/lcov.info",
"version": "npm run changelog && echo && echo === Please edit CHANGELOG.md as desired, then exit === && echo && \"${npm_config_shell:-${SHELL:-bash}}\" && git commit -m \"Update CHANGELOG.md for $npm_package_version\" CHANGELOG.md",
"version-deps": "npm install conventional-changelog-cli david depcheck git-branch-is hub-ci-status"
Expand All @@ -55,6 +55,7 @@
},
"devDependencies": {
"@kevinoid/eslint-config": "^16.0.0",
"c8": "^7.0.0",
"codecov": "^3.0.0",
"coveralls": "^3.0.0",
"eslint": "^7.3.0",
Expand All @@ -67,7 +68,6 @@
"jsdoc": "^3.6.0",
"mocha": "^8.3.0",
"nodecat": "^2.0.0",
"nyc": "^15.0.0",
"rimraf": "^3.0.0"
},
"engines": {
Expand Down

0 comments on commit d72a313

Please sign in to comment.