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 5, 2024
1 parent e67b26a commit 6f28ca0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/jest-coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Jest Coverage Report

on: [pull_request]

jobs:
jest-coverage-report:

runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: 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 6f28ca0

Please sign in to comment.