Skip to content

Commit

Permalink
Merge pull request #15 from cabinetoffice/ntrnl-282-add-coverage-thre…
Browse files Browse the repository at this point in the history
…shold-to-api-sdk

add coverage threshold
  • Loading branch information
DanielMurray97 authored Jan 8, 2024
2 parents 0a715c2 + bc3e0a1 commit 9074ecb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/jest-coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Jest Coverage Report

on: [pull_request]

jobs:
jest-coverage-report:
runs-on: ubuntu-latest

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

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"

- 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 @@ -3,6 +3,11 @@ module.exports = {
testPathIgnorePatterns: ['/node_modules/', '/lib/'],
coveragePathIgnorePatterns: ['/src/index.ts'],
collectCoverageFrom: ['./src/**/*.ts'],
coverageThreshold: {
global: {
lines: 95,
},
},
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
Expand Down

0 comments on commit 9074ecb

Please sign in to comment.