-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.cjs
More file actions
56 lines (54 loc) · 1.29 KB
/
jest.config.cjs
File metadata and controls
56 lines (54 loc) · 1.29 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
const fs = require('fs');
const swcConfig = JSON.parse(fs.readFileSync(`${__dirname}/.swcrc`, 'utf-8'));
module.exports = {
verbose: false,
watchman: false,
detectLeaks: false,
resetMocks: true,
restoreMocks: true,
transform: {
'^.+\\.(t|j)s?$': [
'@swc/jest',
{
...swcConfig,
module: {
...swcConfig.module,
noInterop: false,
},
},
],
},
moduleFileExtensions: ['ts', 'js', 'json'],
moduleNameMapper: {
'graceful-fs': '<rootDir>/test/jest/fs.cjs',
'fs/promises': '<rootDir>/test/jest/fs.cjs',
},
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-extended/all', './test/jest/matchers.ts'],
testSequencer: './test/jest/sequencer.cjs',
testTimeout: 20000,
testMatch: [
'**/+(*.)spec.ts',
'!**/+(*.)e2e(*.)spec.ts', // remove e2e tests from unit test
],
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.ts', //
'!**/__e2e__/**/*.ts',
'!**/__tests__/**/*.ts',
'!**/constants/**/*.ts',
'!**/interfaces/**/*.ts',
'!**/zod-schemas/**/*.ts',
'!**/index.ts',
],
coverageReporters: ['html', 'text-summary'],
coverageThreshold: {
global: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
reporters: ['default'],
};