-
Notifications
You must be signed in to change notification settings - Fork 7
/
jest.config.js
36 lines (33 loc) · 1017 Bytes
/
jest.config.js
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
const { pathsToModuleNameMapper } = require( 'ts-jest/utils' );
const { compilerOptions } = require( './tsconfig' );
const tsConfigAlias = pathsToModuleNameMapper( compilerOptions.paths, {
prefix: '<rootDir>/'
} );
module.exports = {
verbose: true,
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': 'ts-jest',
'\\.(jpg|jpeg|png|gif|webp|svg)$': 'jest-transform-file'
},
moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'],
testPathIgnorePatterns: ['node_modules', '__tests__/mock'],
moduleDirectories: ['app', 'test', 'node_modules'],
moduleNameMapper: {
...tsConfigAlias,
'\\.(css|less|scss|sss|styl)$':
'<rootDir>/node_modules/jest-css-modules'
},
globals: {
navigator: {
onLine: true
},
'ts-jest': {
diagnostics: {
pathRegex: '\\.(spec|test)\\.ts$'
}
}
},
setupFiles: ['<rootDir>/tests_setup.ts']
};