Skip to content

Commit 7dca8ad

Browse files
committed
Simplify Jest configs by removing redundant options and scoping the secondary project to editor and shared tests
- can `apps/editor/jest.config.js` extend `jest.config.js` so that there is less repetition? - don't use base config ├── apps │ └── editor │ └── jest.config.js ├── jest.config.js └── packages └── shared └── tsconfig.json
1 parent f06a820 commit 7dca8ad

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

‎apps/editor/jest.config.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1-
/** @type {import('ts-jest').JestConfigWithTsJest} */
21
module.exports = {
3-
displayName: 'editor',
42
preset: 'ts-jest',
5-
testEnvironment: 'node',
6-
clearMocks: true,
73
testMatch: ['<rootDir>/src/**/*.spec.ts?(x)'],
8-
testPathIgnorePatterns: ['/node_modules/', '/out/', '/dist/'],
94
moduleNameMapper: {
105
'^@shared/(.*)$': '<rootDir>/../../packages/shared/src/$1',
116
'^@/(.*)$': '<rootDir>/src/$1'
127
},
13-
transform: {
14-
'^.+\\.tsx?$': [
15-
'ts-jest',
16-
{
17-
tsconfig: '<rootDir>/tsconfig.json'
18-
}
19-
]
20-
}
218
}

‎jest.config.js‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,14 @@ module.exports = {
33
projects: [
44
'<rootDir>/apps/editor',
55
{
6-
displayName: 'other',
76
preset: 'ts-jest',
8-
testEnvironment: 'node',
9-
clearMocks: true,
107
testMatch: [
11-
'<rootDir>/apps/**/*.spec.ts?(x)',
12-
'<rootDir>/packages/**/*.spec.ts?(x)'
8+
'<rootDir>/apps/editor/src/**/*.spec.ts?(x)',
9+
'<rootDir>/packages/shared/**/*.spec.ts?(x)'
1310
],
1411
testPathIgnorePatterns: [
15-
'/node_modules/',
16-
'/out/',
17-
'/dist/',
1812
'<rootDir>/apps/editor/'
1913
],
20-
moduleNameMapper: {
21-
'^@shared/(.*)$': '<rootDir>/packages/shared/src/$1'
22-
}
2314
}
2415
]
2516
}

0 commit comments

Comments
 (0)