-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
32 lines (29 loc) · 889 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
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/**/*.(t|j)s', '!src/index.ts'],
coverageDirectory: '../coverage',
coverageThreshold: {
global: {
functions: 80,
lines: 60,
statements: 60,
branches: 50,
},
},
modulePathIgnorePatterns: ['<rootDir>/app/', '<rootDir>/dist/'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
testEnvironment: 'node',
testPathIgnorePatterns: ['<rootDir>/jest.config.ts', '<rootDir>/src/index.ts'],
};
export default config;