Skip to content

Commit a4c3fd4

Browse files
committed
added code coverage threasholds
1 parent caabdd2 commit a4c3fd4

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/node.js.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
41
name: Node.js CI
52

63
on:
@@ -20,12 +17,17 @@ jobs:
2017

2118
steps:
2219
- uses: actions/checkout@v3
20+
2321
- name: Use Node.js ${{ matrix.node-version }}
2422
uses: actions/setup-node@v3
2523
with:
2624
node-version: ${{ matrix.node-version }}
2725
cache: "npm"
26+
2827
- run: npm ci
2928
- run: npm run build --if-present
3029
- run: npm run lint --if-present
3130
- run: npm test
31+
32+
- name: Run tests with coverage
33+
run: npm run test:coverage

jest.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,14 @@ module.exports = {
55
preset: "ts-jest",
66
testEnvironment: "node",
77
testMatch: ["**/tests/**/*.test.ts"],
8-
verbose: true
8+
verbose: true,
9+
collectCoverage: true,
10+
coverageThreshold: {
11+
global: {
12+
branches: 80,
13+
functions: 80,
14+
lines: 80,
15+
statements: 80
16+
}
17+
}
918
};

0 commit comments

Comments
 (0)