Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track coverage using C8 #96

Merged
merged 3 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- run: npm run test:coverage
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lint": "eslint src/*.js test/*.js",
"test-generate-mo": "msgfmt test/fixtures/latin13.po -o test/fixtures/latin13.mo & msgfmt test/fixtures/utf8.po -o test/fixtures/utf8.mo & msgfmt test/fixtures/obsolete.po -o test/fixtures/obsolete.mo",
"test": "mocha",
"test:coverage": "npx c8 --check-coverage npm run test",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add c8 as a dev dependency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I would not want to add more dependencies, the ideal thing for this repo would be to switch to the node's bundled test suite , which already has everything we need without installing nothing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. I don't think it is really limiting and since its use is limited to certain cases it can speed up the installation by not having it in the package.json. and then I am of the opinion that less is better

in any case if you think this will cause problems I will include it in the json package, alternatively I would proceed with the merge on the development branch so that we can know the coverage for each new PR

"preversion": "npm run lint && npm test",
"postversion": "git push && git push --tags",
"prepublishOnly": "npm i && tsc && npm run lint && npm run test"
Expand All @@ -46,7 +47,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"mocha": "^10.3.0",
"mocha": "^10.4.0",
"typescript": "^5.4.5"
},
"keywords": [
Expand Down