-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.cjs
54 lines (53 loc) · 1.21 KB
/
jest.config.cjs
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
/** @type {import('ts-jest').JestConfigWithTsJest} */
const commonConfig = {
testEnvironment: 'node',
rootDir: './src',
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^lodash-es$': 'lodash',
},
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},
};
/** @type {import('jest').Config} */
module.exports = {
projects: [
{
displayName: 'unit',
testRegex: '.*\\.spec\\.ts$',
...commonConfig,
},
{
displayName: 'integration',
testRegex: '/.*\\.integration-spec\\.ts$',
...commonConfig,
},
],
coverageDirectory: './coverage',
coverageProvider: 'babel',
collectCoverageFrom: [
'**/*.ts',
'!**/*.d.ts',
'!**/*.spec.ts',
'!**/*.integration-spec.ts',
'!**/index.ts',
'!**/main.ts',
'!**/*.types.ts',
],
coverageThreshold: {
global: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
testTimeout: 1000000,
};