-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.ts
37 lines (34 loc) · 1.03 KB
/
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
import { pathsToModuleNameMapper } from 'ts-jest'
import type { JestConfigWithTsJest } from 'ts-jest'
import { compilerOptions } from './tsconfig.json'
const config: JestConfigWithTsJest = {
verbose: true,
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: '.*\\.spec\\.ts$',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
collectCoverageFrom: ['src/lib/**/*.(t|j)s'],
coverageDirectory: '../coverage',
coverageThreshold: {
global: {
functions: 80,
lines: 60,
statements: 60,
branches: 50,
},
},
modulePathIgnorePatterns: ['<rootDir>/app/', '<rootDir>/dist/'],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
'tiny-invariant':
'<rootDir>/node_modules/tiny-invariant/src/tiny-invariant.flow.js',
},
testEnvironment: 'node',
testPathIgnorePatterns: ['<rootDir>/jest.config.ts', '<rootDir>/src/index.ts'],
transformIgnorePatterns: ['/node_modules/(?!tiny-invariant)'],
}
export default config