Skip to content

Commit

Permalink
fix code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Nov 6, 2024
1 parent 71902b1 commit 8bebae3
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 6 deletions.
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

0 comments on commit 8bebae3

Please sign in to comment.