-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
28 lines (24 loc) · 990 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
// eslint-disable-next-line import/no-extraneous-dependencies
import { Config } from '@jest/types';
// eslint-disable-next-line import/no-extraneous-dependencies
import { pathsToModuleNameMapper } from 'ts-jest';
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { compilerOptions } = require('./tsconfig.json');
process.env.TZ = 'UTC';
const jestConfig: Config.InitialOptions = {
moduleFileExtensions: ['js', 'ts'],
// https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping/
moduleNameMapper: compilerOptions.paths
? pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/..' })
: undefined,
rootDir: 'src',
testRegex: '.*\\.spec\\.ts$',
transform: {
'\\.ts?$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
},
preset: 'ts-jest',
coverageDirectory: '../coverage',
testEnvironment: 'node',
collectCoverageFrom: ['<rootDir>/**/**.ts', '!<rootDir>/configs/recommended.ts'],
};
export default jestConfig;