Skip to content

Commit

Permalink
add jest coverage threshold check in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
harley-harris committed Jan 4, 2024
1 parent e67b26a commit d5fab55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ module.exports = {
roots: ['<rootDir>/src', '<rootDir>/test'],
testPathIgnorePatterns: ['/node_modules/', '/lib/'],
collectCoverageFrom: ['./src/**/*.ts'],
coverageReporters: ['text', 'json-summary'],
coverageThreshold: {
global: {
lines: 95,
},
},
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
Expand Down

0 comments on commit d5fab55

Please sign in to comment.