Skip to content

Commit 2c835f8

Browse files
committed
ci: ensure code converage up to 100%
1 parent 97181ce commit 2c835f8

File tree

4 files changed

+20
-33
lines changed

4 files changed

+20
-33
lines changed

.github/workflows/reusable-test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: npm ci
3232

3333
- name: Run tests
34-
run: npm test
34+
run: npm run jest
3535

3636
# Run legacy tests on multiple matrix Node.js versions
3737
run-tests-legacy-node13:
@@ -59,8 +59,11 @@ jobs:
5959
with:
6060
node-version: ${{ matrix.node-version }}
6161

62+
- name: Build typescript to tslib
63+
run: npm run ts2lib
64+
6265
- name: Run tests
63-
run: npm run test-legacy
66+
run: npm run jest:legacy
6467

6568
# Run legacy tests on multiple matrix Node.js versions
6669
run-tests-legacy-node15:
@@ -88,8 +91,11 @@ jobs:
8891
with:
8992
node-version: ${{ matrix.node-version }}
9093

94+
- name: Build typescript to tslib
95+
run: npm run ts2lib
96+
9197
- name: Run tests
92-
run: npm run test-legacy
98+
run: npm run jest:legacy
9399

94100
# Run tests on multiple matrix Node.js versions
95101
run-tests-modern-nodes:
@@ -117,7 +123,7 @@ jobs:
117123
node-version: ${{ matrix.node-version }}
118124

119125
- name: Run tests
120-
run: npm test
126+
run: npm run jest
121127

122128
# This job is used to run tests on legacy Node.js versions
123129
# 1. Use default Node.js

.github/workflows/test.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ module.exports = {
1414
testMatch: ['<rootDir>/test/**/*.{spec,test}.{ts,tsx}'],
1515
setupFiles: ['./test/jest.setup.ts'],
1616
collectCoverage: true,
17+
coverageThreshold: {
18+
global: {
19+
branches: 100,
20+
functions: 100,
21+
lines: 100,
22+
statements: 100,
23+
},
24+
},
25+
coverageReporters: ['json', 'lcov', 'text', 'clover'],
1726
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
1827
coveragePathIgnorePatterns: ['src/types.ts'],
1928
moduleNameMapper: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"copy-lib": "mkdir -p lib && shx cp -r tslib/src/* lib",
7676
"add-umd-header": "tsx scripts/add-umd-header-comments.ts",
7777
"prepublishOnly": "npm run build && npm run test",
78-
"test": "run-p jest jest:legacy",
78+
"test": "npm run jest",
7979
"jest": "jest --coverage",
8080
"jest:legacy": "jest --coverage -c jest-legacy.config.js",
8181
"test:browser:bundle": "tsx scripts/browser-test-bundle.ts",

0 commit comments

Comments
 (0)