-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
31 lines (30 loc) · 942 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
import { Config } from '@jest/types';
/**
* ts-jest 测试配置文件
*/
export default async (): Promise<Config.InitialOptions> => {
return {
verbose: true,
bail: true,
noStackTrace: true,
// coverage
collectCoverage: !!process.env.coverage,
coverageDirectory: '__coverage__',
coveragePathIgnorePatterns: ['/node_modules/'],
coverageReporters: ['json', 'html'],
coverageThreshold: {
global: {
branches: 0,
functions: 20,
lines: 50,
statements: 50
}
},
testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.ts'],
testPathIgnorePatterns: ['/node_modules/'],
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
transform: { '^.+\\.ts$': 'ts-jest' },
transformIgnorePatterns: ['node_modules/(?!variables/.*)']
};
};