-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.cjs
More file actions
84 lines (71 loc) · 2.26 KB
/
jest.config.cjs
File metadata and controls
84 lines (71 loc) · 2.26 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/** @type {import('jest').Config} */
module.exports = {
projects: [
// -------------------------
// SERVER TESTS (Node)
// -------------------------
{
displayName: 'server',
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
testMatch: [
'<rootDir>/**/**-server/**/*.test.ts',
'<rootDir>/**/**-server/**/*.spec.ts',
'<rootDir>/**/**-server/**/__tests__/**/*.test.ts',
'<rootDir>/**/**-server/**/__tests__/**/*.spec.ts',
],
extensionsToTreatAsEsm: ['.ts'],
transform: {
'^.+\\.ts$': [
'ts-jest',
{
useESM: true,
tsconfig: '<rootDir>/tsconfig.jest.server.json',
},
],
},
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/coverage/'],
coverageDirectory: '<rootDir>/coverage/server',
coverageReporters: ['json-summary'],
},
// -------------------------
// CLIENT TESTS (jsdom)
// -------------------------
{
displayName: 'client',
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/**/**-client/**/*.test.ts',
'<rootDir>/**/**-client/**/*.test.tsx',
'<rootDir>/**/**-client/**/*.spec.ts',
'<rootDir>/**/**-client/**/*.spec.tsx',
'<rootDir>/**/**-client/**/__tests__/**/*.test.ts',
'<rootDir>/**/**-client/**/__tests__/**/*.test.tsx',
'<rootDir>/**/**-client/**/__tests__/**/*.spec.ts',
'<rootDir>/**/**-client/**/__tests__/**/*.spec.tsx',
],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
useESM: true,
tsconfig: '<rootDir>/tsconfig.jest.client.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/coverage/'],
coverageDirectory: '<rootDir>/coverage/client',
coverageReporters: ['json-summary'],
},
],
};