@vyriy/jest-config 0.1.18 → 0.1.21

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.
Files changed (3) hide show
  1. package/README.md +37 -0
  2. package/index.js +14 -7
  3. 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,24 @@ const config = {
2
2
  clearMocks: true,
3
3
  collectCoverage: true,
4
4
  collectCoverageFrom: [
5
- '<rootDir>/packages/**/*.{ts,tsx}',
6
- '<rootDir>/stack/*.ts',
7
- '!<rootDir>/packages/**/*.d.ts',
8
- '!<rootDir>/packages/**/index.{ts,tsx}',
9
- '!<rootDir>/packages/**/*.stories.{ts,tsx}',
10
- '!<rootDir>/packages/**/*.types.ts',
11
- '!<rootDir>/packages/**/types.ts',
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',
12
11
  ],
13
12
  coverageDirectory: 'coverage',
14
13
  coveragePathIgnorePatterns: [
15
14
  '/node_modules/',
15
+ '<rootDir>/storybook-static/',
16
+ '<rootDir>/dist/',
17
+ '<rootDir>/build/',
18
+ '<rootDir>/bin/',
19
+ '<rootDir>/.bin/',
20
+ '<rootDir>/.storybook/',
21
+ '<rootDir>/coverage/',
22
+ '<rootDir>/.yarn/',
16
23
  ],
17
24
  coverageProvider: 'v8',
18
25
  coverageReporters: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vyriy/jest-config",
3
- "version": "0.1.18",
3
+ "version": "0.1.21",
4
4
  "description": "Shared Jest config for Vyriy projects",
5
5
  "type": "module",
6
6
  "main": "./index.js",