@vyriy/jest-config 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/index.js +16 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,43 @@ This package provides the base Jest setup used in Vyriy repositories for:
|
|
|
12
12
|
- coverage defaults
|
|
13
13
|
- JUnit reporting
|
|
14
14
|
|
|
15
|
+
## Coverage
|
|
16
|
+
|
|
17
|
+
Coverage is enabled by default and collected from:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
[
|
|
21
|
+
'<rootDir>/**/*.{ts,tsx,js,jsx,mjs,cjs}',
|
|
22
|
+
'!<rootDir>/**/*.d.ts',
|
|
23
|
+
'!<rootDir>/**/*.stories.{ts,tsx}',
|
|
24
|
+
'!<rootDir>/**/*.types.ts',
|
|
25
|
+
'!<rootDir>/**/types.ts',
|
|
26
|
+
'!<rootDir>/*.config.ts',
|
|
27
|
+
];
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Coverage paths ignore generated output, package manager state, Storybook output, and common build folders:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
[
|
|
34
|
+
'/node_modules/',
|
|
35
|
+
'<rootDir>/storybook-static/',
|
|
36
|
+
'<rootDir>/dist/',
|
|
37
|
+
'<rootDir>/build/',
|
|
38
|
+
'<rootDir>/bin/',
|
|
39
|
+
'<rootDir>/.bin/',
|
|
40
|
+
'<rootDir>/.storybook/',
|
|
41
|
+
'<rootDir>/coverage/',
|
|
42
|
+
'<rootDir>/.yarn/',
|
|
43
|
+
];
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Reports are written to `coverage` using `json`, `text`, `text-summary`, `lcov`, `clover`, and `cobertura` reporters. The shared default requires 100% global coverage for branches, functions, lines, and statements.
|
|
47
|
+
|
|
48
|
+
## CI Reports
|
|
49
|
+
|
|
50
|
+
The config includes `jest-junit` alongside the default Jest reporter. This writes a JUnit report to `coverage/junit.xml`, which CI systems such as GitLab can publish as a test report artifact.
|
|
51
|
+
|
|
15
52
|
## Install
|
|
16
53
|
|
|
17
54
|
With npm:
|
package/index.js
CHANGED
|
@@ -2,17 +2,26 @@ const config = {
|
|
|
2
2
|
clearMocks: true,
|
|
3
3
|
collectCoverage: true,
|
|
4
4
|
collectCoverageFrom: [
|
|
5
|
-
'<rootDir
|
|
6
|
-
'
|
|
7
|
-
'!<rootDir
|
|
8
|
-
'!<rootDir
|
|
9
|
-
'!<rootDir
|
|
10
|
-
'!<rootDir
|
|
11
|
-
'!<rootDir
|
|
5
|
+
'<rootDir>/**/*.{ts,tsx,js,jsx,mjs,cjs}',
|
|
6
|
+
'!<rootDir>/**/*.d.ts',
|
|
7
|
+
'!<rootDir>/**/*.stories.{ts,tsx}',
|
|
8
|
+
'!<rootDir>/**/*.types.ts',
|
|
9
|
+
'!<rootDir>/**/types.ts',
|
|
10
|
+
'!<rootDir>/*.config.{ts,mjs}',
|
|
11
|
+
'!<rootDir>/**/*.config.{ts,mjs}',
|
|
12
12
|
],
|
|
13
13
|
coverageDirectory: 'coverage',
|
|
14
14
|
coveragePathIgnorePatterns: [
|
|
15
15
|
'/node_modules/',
|
|
16
|
+
'<rootDir>/storybook-static/',
|
|
17
|
+
'<rootDir>/dist/',
|
|
18
|
+
'<rootDir>/build/',
|
|
19
|
+
'<rootDir>/bin/',
|
|
20
|
+
'<rootDir>/.bin/',
|
|
21
|
+
'<rootDir>/.storybook/',
|
|
22
|
+
'<rootDir>/coverage/',
|
|
23
|
+
'<rootDir>/.yarn/',
|
|
24
|
+
'<rootDir>/e2e/',
|
|
16
25
|
],
|
|
17
26
|
coverageProvider: 'v8',
|
|
18
27
|
coverageReporters: [
|