-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathjest.config.ts
More file actions
31 lines (28 loc) · 937 Bytes
/
jest.config.ts
File metadata and controls
31 lines (28 loc) · 937 Bytes
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
import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src/core', '<rootDir>/tests'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/*.(test|spec).+(ts|tsx|js)'
],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest'
},
collectCoverageFrom: [
'src/core/**/*.{ts,tsx}',
'!src/core/**/*.d.ts',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', 'd.ts'],
testTimeout: 100000,
verbose: true,
// 失败测试汇总选项
bail: false, // 不因第一个失败而停止
maxWorkers: 1, // 单线程运行,便于查看错误
forceExit: true,
detectOpenHandles: true,
globalTeardown: '<rootDir>/src/core/test/global-teardown.ts',
setupFilesAfterEnv: ['<rootDir>/src/core/test/setup-after-env.ts'],
};
export default config;