-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathjest.config.js
31 lines (30 loc) · 874 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
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig');
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: {
window: {},
},
moduleFileExtensions: ['ts', 'js', 'jsx', 'tsx', 'json', 'node'],
roots: ['<rootDir>/src/', 'node_modules'],
modulePaths: ['<rootDir>', 'node_modules'],
moduleDirectories: ['src', 'node_modules'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.(ts|tsx)$': 'ts-jest',
},
transformIgnorePatterns: ['\\.pnp\\.[^\\/]+$'],
collectCoverage: true,
coverageThreshold: {
global: {
branches: 99,
functions: 99,
lines: 99,
statements: 99,
},
},
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
modulePathIgnorePatterns: ['/dist/'],
};