Skip to content

Commit 6727ec7

Browse files
committed
feat(test-coverage): Added test coverage thresholds and a hushy/pre-push to monitor the threshods
1 parent 2849b88 commit 6727ec7

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
npx lint-staged
1+
npx lint-staged || {
2+
printf "\n\nERROR: Linting issues were found in the committed files. Please address them before proceeding.\n\n\n\n"
3+
exit 1
4+
}

.husky/pre-push

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
npm run build
2+
3+
npm run test:coverage || {
4+
echo "ERROR: Testing errors or coverage issues were found. Please address them before proceeding."
5+
exit 1
6+
}

jest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ module.exports = {
3030
'!src/app/**/public-api.ts',
3131
],
3232
extensionsToTreatAsEsm: ['.ts'],
33+
coverageThreshold: {
34+
global: {
35+
statements: 37.83,
36+
branches: 11.89,
37+
functions: 12.12,
38+
lines: 37.27,
39+
},
40+
},
3341
testPathIgnorePatterns: [
3442
'<rootDir>/src/app/features/registry/',
3543
'<rootDir>/src/app/features/project/',

0 commit comments

Comments
 (0)