-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
29 lines (26 loc) · 865 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
import type { Config } from '@jest/types';
import { pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.paths.json';
const config: Config.InitialOptions = {
verbose: true,
testRegex: '.*\\.spec\\.ts$',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
coveragePathIgnorePatterns: ['<rootDir>/node_modules/'],
coverageDirectory: '<rootDir>/coverage',
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
testEnvironment: 'node',
moduleDirectories: ['<rootDir>/src', '<rootDir>/test', 'node_modules'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
modulePathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/dist/'],
setupFiles: ['<rootDir>/test/setEnvVars.ts'],
};
export default config;