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

fix code coverage #1847

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ jobs:
- run: npm ci
- run: npm run lint
- run: npm run test:coverage
- run: npx codecov
continue-on-error: true
- name: Codecov
if: ${{ contains(matrix.node-version, '22') }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: ./coverage-reports/codecov.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.log
.idea
*.iml
dist
/coverage-reports
18 changes: 18 additions & 0 deletions mcr.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
name: 'Koa Coverage Report',
cleanCache: true,
reports: [
'console-details',
'v8-json',
'v8',
'codecov'
],
entryFilter: {
'**/node_modules/**': false,
'**/__tests__/**': false,
'**/lib/**': true
},
onEnd: (results) => {
console.log(`coverage report generated: ${results.reportPath}`)
}
}
214 changes: 211 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"test": "node --test",
"test:coverage": "node --test --experimental-test-coverage",
"test:coverage": "node --test-reporter=node-monocart-coverage --test",
"lint": "standard",
"lint:pretty": "standard | snazzy",
"authors": "git log --format='%aN <%aE>' | sort -u > AUTHORS",
Expand Down Expand Up @@ -60,6 +60,7 @@
},
"devDependencies": {
"gen-esm-wrapper": "^1.0.6",
"node-monocart-coverage": "^1.0.2",
"snazzy": "^9.0.0",
"standard": "^17.1.0",
"supertest": "^7.0.0"
Expand Down