Skip to content

Commit

Permalink
feat: scope jest ignores (#496)
Browse files Browse the repository at this point in the history
Signed-off-by: hxtree <[email protected]>
  • Loading branch information
hxtree authored Nov 5, 2023
1 parent ed59cbc commit e2d45ce
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 69 deletions.
15 changes: 0 additions & 15 deletions libraries/faker-factory/jest.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions libraries/faker-factory/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"roots": ["<rootDir>/src/"],
"testMatch": ["<rootDir>/src/**/*.test.ts"],
"testPathIgnorePatterns": ["/node_modules/"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"collectCoverageFrom": ["<rootDir>/src/*.ts"],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["index.ts"],
"coverageDirectory": "<rootDir>/coverage"
}
15 changes: 0 additions & 15 deletions libraries/messaging-schemas/jest.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions libraries/messaging-schemas/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"roots": ["<rootDir>/src/"],
"testMatch": ["<rootDir>/src/**/*.test.ts"],
"testPathIgnorePatterns": ["/node_modules/"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"collectCoverageFrom": ["<rootDir>/src/*.ts"],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["index.ts"],
"coverageDirectory": "<rootDir>/coverage"
}
13 changes: 0 additions & 13 deletions libraries/nestjs-modules/jest.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions libraries/nestjs-modules/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"roots": ["<rootDir>/src/"],
"testMatch": ["<rootDir>/src/**/*.test.ts"],
"testPathIgnorePatterns": ["/node_modules/"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"collectCoverageFrom": ["<rootDir>/src/*.ts"],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["index.ts"],
"coverageDirectory": "<rootDir>/coverage"
}
15 changes: 0 additions & 15 deletions libraries/validation-schemas/jest.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions libraries/validation-schemas/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"roots": ["<rootDir>/src/"],
"testMatch": ["<rootDir>/src/**/*.test.ts"],
"testPathIgnorePatterns": ["/node_modules/"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"collectCoverageFrom": ["<rootDir>/src/*.ts"],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["index.ts"],
"coverageDirectory": "<rootDir>/coverage"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"collectCoverageFrom": ["<rootDir>/src/*.ts", "!<rootDir>/src/index.ts"],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["/node_modules/", "/cdk.out/", "/dist/"],
"coveragePathIgnorePatterns": ["main.ts", "app.ts", "index.ts", "/data/"],
"coverageDirectory": "<rootDir>/coverage"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"collectCoverageFrom": ["<rootDir>/src/*.ts", "!<rootDir>/src/index.ts"],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["/node_modules/", "/cdk.out/", "/dist/"],
"coveragePathIgnorePatterns": ["main.ts", "app.ts", "index.ts", "/data/"],
"coverageDirectory": "<rootDir>/coverage"
}
13 changes: 9 additions & 4 deletions platform/rigs/base-nodejs/profiles/nestjs-app/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@
"roots": ["<rootDir>/src/", "<rootDir>/stacks/"],
"testMatch": [
"<rootDir>/src/**/*.{test,e2e-spec}.ts",
"<rootDir>/src/__tests__/**/*.test.ts",
"<rootDir>/stacks/**/*.test.ts"
],
"testPathIgnorePatterns": ["/node_modules/"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"collectCoverageFrom": [
"<rootDir>/src/*.ts",
"<rootDir>/stacks/*.ts",
"!<rootDir>/src/index.ts"
"<rootDir>/src/**/*.ts",
"<rootDir>/stacks/**/*.ts",
"!<rootDir>/src/index.ts",
"!<rootDir>/src/**/*.module.ts",
"!<rootDir>/src/main.ts",
"!<rootDir>/src/app.ts",
"!<rootDir>/src/**/index.ts",
"!<rootDir>/src/**/data/**"
],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["/node_modules/", "/cdk.out/", "/dist/"],
"coverageDirectory": "<rootDir>/coverage"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"!<rootDir>/stacks/**/index.ts"
],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["/node_modules/", "/cdk.out/", "/dist/"],
"coveragePathIgnorePatterns": ["main.ts", "app.ts", "index.ts", "/data/"],
"coverageDirectory": "<rootDir>/coverage"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"collectCoverageFrom": ["<rootDir>/src/*.ts", "!<rootDir>/src/**/index.ts"],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["/node_modules/", "/cdk.out/", "/dist/"],
"coveragePathIgnorePatterns": ["main.ts", "app.ts", "index.ts", "/data/"],
"coverageDirectory": "<rootDir>/coverage"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"!<rootDir>/stacks/**/index.ts"
],
"coverageReporters": ["json", "text-summary"],
"coveragePathIgnorePatterns": ["/node_modules/", "/cdk.out/", "/dist/"],
"coveragePathIgnorePatterns": ["main.ts", "app.ts", "index.ts", "/data/"],
"coverageDirectory": "<rootDir>/coverage"
}
10 changes: 9 additions & 1 deletion platform/rigs/base-nodejs/profiles/react-app/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
"collectCoverage": true,
"collectCoverageFrom": ["<rootDir>/src/**/*.{ts,tsx}"],
"coverageReporters": ["text-summary", "clover"],
"coveragePathIgnorePatterns": ["/node_modules/", "/cdk.out/", "/dist/"],
"coveragePathIgnorePatterns": [
"/**/main.ts",
"/**/app.ts",
"/**/index.ts",
"/**/data/",
"/node_modules/",
"/cdk.out/",
"/dist/"
],
"coverageDirectory": "<rootDir>/src/__tests__/coverage"
}
3 changes: 2 additions & 1 deletion services/admin-client/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ module.exports = {
// on node 14.x coverage provider v8 offers good speed and more or less good report
coverageProvider: 'v8',
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'components/**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!<rootDir>/out/**',
'!<rootDir>/.next/**',
'!<rootDir>/*.config.js',
'!<rootDir>/coverage/**',
'!<rootDir>/pages/**',
],
moduleNameMapper: {
// Handle CSS imports (with CSS modules)
Expand Down

0 comments on commit e2d45ce

Please sign in to comment.