Skip to content

Commit ff12048

Browse files
committed
test: add test coverage criteria
1 parent df48947 commit ff12048

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

configs/jest.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ const config: Config = {
1414
collectCoverage: true,
1515
coverageDirectory: './coverage',
1616
collectCoverageFrom: ['./src/*.{ts,js,jsx}'],
17+
coverageThreshold: {
18+
global: {
19+
branches: 80, // The number of the branches of the control structures, like if-then, that have been executed.
20+
functions: 80, // The number of functions that have been called.
21+
lines: 80, // The number of lines of source code that have been tested. a Line can have multiply statements e.g. const a = 1; b = 2;
22+
statements: 80, // The number of statements that have been executed.
23+
},
24+
},
1725
};
1826

1927
export default config;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "npm-template-typescript",
3-
"version": "0.0.2-test",
3+
"version": "0.0.3-test",
44
"description": "Typescript template to build npm package",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

0 commit comments

Comments
 (0)