-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
55 lines (52 loc) · 1.08 KB
/
jest.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type { Config } from 'jest'
const RootConfig: Config = {
preset: 'ts-jest',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
},
moduleNameMapper: {
uuid: require.resolve('uuid'),
rxjs: require.resolve('rxjs'),
},
testMatch: ['<rootDir>/src/**/*.test(.ts|.tsx)'],
prettierPath: require.resolve('prettier-2'),
}
const JestConfig: Config = {
globals: {
'ts-jest': {
isolatedModules: false,
},
},
// note <rootDir> here means each project root
collectCoverageFrom: [
'<rootDir>/**/*.ts',
'!**/node_modules/**',
'!**/dist/**',
'!**/*.config.ts',
'!**/index.ts',
],
coverageThreshold: {
global: {
statements: 60,
branches: 70,
functions: 85,
lines: 60,
},
},
coverageDirectory: '.jest/coverage',
projects: [
{
...RootConfig,
displayName: 'app',
rootDir: './frontend/app',
testEnvironment: 'jsdom',
},
{
...RootConfig,
displayName: 'pong',
rootDir: './frontend/pong',
testEnvironment: 'jsdom',
},
],
}
export default JestConfig