-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathjest.config.ts
41 lines (38 loc) · 989 Bytes
/
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
import type { Config } from '@jest/types';
import inspector from 'inspector';
// If we are debugging then extend the timeout to max value, otherwise use the default.
const testTimeout = inspector.url() ? 1e8 : 10e3;
const config: Config.InitialOptions = {
testEnvironment: 'node',
transform: {
'^.+\\.(j|t)s$': [
'@swc/jest',
{
jsc: { target: 'es2019' },
},
],
},
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
collectCoverage: true,
coverageThreshold: {
global: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
coveragePathIgnorePatterns: ['<rootDir>/test/', '/node_modules/'],
clearMocks: true,
resetMocks: true,
restoreMocks: true,
testMatch: [
'<rootDir>/test/**/*.test.ts',
],
verbose: true,
maxWorkers: '50%',
testTimeout,
// need to transform imported js file using ESM
transformIgnorePatterns: ['/node_modules/(?!(axios)/)'],
};
export default config;