Skip to content

Commit f821839

Browse files
committed
Adding coverage
1 parent f410da9 commit f821839

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@
3131
"\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
3232
},
3333
"testRegex": "/__tests__/.*\\.(ts|tsx|js)$",
34-
"collectCoverageFrom": [
35-
"src/**/*.{js,jsx,ts,tsx}",
34+
"collectCoverageFrom": [
35+
"src/**/{!(index),}.ts",
3636
"!<rootDir>/node_modules/",
3737
"!<rootDir>/path/to/dir/"
3838
],
39+
"testPathIgnorePatterns": [
40+
"./src/index.ts"
41+
],
3942
"coverageThreshold": {
4043
"global": {
4144
"branches": 90,

src/__tests__/start-kit-example-class.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ describe('On2StarterKit', () => {
88
it('hello', () => {
99
expect(start.hello()).toBe(true);
1010
});
11+
it('bla', () => {
12+
expect(start.bla(true)).toBe(true);
13+
expect(start.bla()).toBe(false);
14+
});
1115
});

src/starter-kit-example-class.ts

+8
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ export default class On2StarterKit {
55
hello() {
66
return true;
77
}
8+
9+
bla(p?: boolean) {
10+
if (p) {
11+
return true;
12+
} else {
13+
return false;
14+
}
15+
}
816
}

0 commit comments

Comments
 (0)