-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
34 lines (32 loc) · 1.04 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
/* eslint-disable @typescript-eslint/no-var-requires */
const { jsWithTs: tsjPreset } = require('ts-jest/presets');
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const tsconfig = require('tsconfig');
const { config } = tsconfig.loadSync(__dirname);
const jestConfig = {
roots: ['<rootDir>/src'],
testRegex: '.+\\.spec\\.(tsx?)$',
transform: tsjPreset.transform,
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50,
},
},
setupFiles: ['core-js', '<rootDir>/test/utils/configure.ts'],
moduleNameMapper: {
// TS Paths
...pathsToModuleNameMapper(config.compilerOptions.paths, {
prefix: '<rootDir>',
}),
// Mock electron environment
electron: '<rootDir>/test/mocks/electron.mock.js',
// Mock Statics / Externals
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/test/mocks/file.mock.js',
'\\.(css|less)$': '<rootDir>/test/mocks/style.mock.js',
},
};
module.exports = jestConfig;