-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
45 lines (44 loc) · 1.36 KB
/
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
37
38
39
40
41
42
43
44
45
/* eslint-env node */
const esModules = ['lodash-es'].join('|');
module.exports = {
globals: {
__DEV__: true,
// Remove if using `const enums`
// See https://huafu.github.io/ts-jest/user/config/isolatedModules#example
'ts-jest': {
isolatedModules: true,
},
},
setupFilesAfterEnv: ['./test/jest.setup.ts'],
// noStackTrace: true,
// bail: true,
// cache: false,
// verbose: true,
// watch: true,
collectCoverage: true,
coverageDirectory: '<rootDir>/test/coverage',
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
coverageThreshold: {
global: {
// branches: 50,
// functions: 50,
// lines: 50,
// statements: 50
},
},
testMatch: ['<rootDir>/test/**/*.spec.ts', '<rootDir>/src/**/*.jest.spec.ts'],
moduleFileExtensions: ['js', 'json', 'ts'],
moduleNameMapper: {
'^~/(.*)$': '<rootDir>/$1',
'^src/(.*)$': '<rootDir>/src/$1',
},
transform: {
// Jest fire off an error when JS file are not already compiled
// We use babel-jest to compile them
// See https://github.com/nrwl/nx/issues/812#issuecomment-429488470
// See https://jestjs.io/docs/en/configuration.html#transformignorepatterns-array-string
// [`^(${esModules}).+\\.js$`]: 'babel-jest',
'^.+\\.(ts|js|html)$': 'ts-jest',
},
transformIgnorePatterns: [`<rootDir>/node_modules/(?!(${esModules}))`],
};