-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.js
More file actions
50 lines (49 loc) · 1.25 KB
/
jest.config.js
File metadata and controls
50 lines (49 loc) · 1.25 KB
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
46
47
48
49
50
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig.json');
/** @typedef {import('ts-jest/dist/types')} */
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
rootDir: './',
transform: {
'^.+\\.[t]sx?$': 'ts-jest'
},
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/index.ts'
],
cacheDirectory: '<rootDir>/tests/cache',
coverageDirectory: '<rootDir>/tests/coverage',
coverageProvider: 'babel',
coverageReporters: [
'json',
'text-summary',
'json-summary',
'lcov'
],
testMatch: [
'<rootDir>tests/**/*(*.)@(test).[tj]s?(x)'
],
automock: false,
unmockedModulePathPatterns: [
'<rootDir>/node_modules/'
],
errorOnDeprecated: true,
testPathIgnorePatterns: [
'/node_modules/'
],
bail: true,
notify: true,
notifyMode: 'failure-change',
globals: {
window: {}
},
extraGlobals: [
'Function',
'Array',
'String',
'Math'
]
};