Skip to content

Commit

Permalink
add jest coverage threshold check in prepush and github action covera…
Browse files Browse the repository at this point in the history
…ge table
  • Loading branch information
harley-harris committed Jan 4, 2024
1 parent e67b26a commit 0a33886
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm test

- name: Jest Coverage Report
uses: ArtiomTr/jest-coverage-report-action@v2
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test
npm run coverage
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ module.exports = {
roots: ['<rootDir>/src', '<rootDir>/test'],
testPathIgnorePatterns: ['/node_modules/', '/lib/'],
collectCoverageFrom: ['./src/**/*.ts'],
coverageThreshold: {
global: {
lines: 95,
},
},
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
Expand Down

0 comments on commit 0a33886

Please sign in to comment.