-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
51 lines (48 loc) · 1.66 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
46
47
48
49
50
51
/* eslint-disable @typescript-eslint/no-var-requires */
const nextJest = require('next/jest');
const createJestConfig = nextJest({
dir: './renderer',
});
/** @type {import('jest').Config} */
const customJestConfig = {
preset: 'ts-jest',
moduleDirectories: ['node_modules', '<rootDir>/renderer'],
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['node_modules'],
moduleNameMapper: {
'^@repositories/(.*)$': '<rootDir>/renderer/src/commons/repositories/$1',
'^@dataSources/(.*)': '<rootDir>/renderer/src/commons/dataSources/$1',
'^@constants/(.*)': '<rootDir>/renderer/src/commons/constants/$1',
'^@type/(.*)': '<rootDir>/renderer/src/commons/type/$1',
'^@contexts/(.*)': '<rootDir>/renderer/src/commons/contexts/$1',
'^@utils/(.*)': '<rootDir>/renderer/src/commons/utils/$1',
},
collectCoverageFrom: [
'renderer/src/**/*.[jt]s?(x)',
'!renderer/pages/',
'!renderer/src/commons/settings/*.[jt]s?(x)',
'!renderer/src/commons/dataSources/**/*.[jt]s?(x)',
'!renderer/src/commons/repositories/**/*.[jt]s?(x)',
'!renderer/src/commons/constants/*.[jt]s?(x)',
'!renderer/src/commons/utils/*.[jt]s?(x)',
'!renderer/src/commons/type/container.ts',
'!renderer/src/components/common/**/*.[jt]s?(x)',
'!**/*.styles.[jt]s?(x)',
'!**/*.types.[jt]s?(x)',
],
coverageThreshold: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
setupFilesAfterEnv: [
'@testing-library/jest-dom/extend-expect',
'jest-plugin-context/setup',
],
setupFiles: ['jest-plugin-context/setup'],
verbose: true,
};
module.exports = createJestConfig(customJestConfig);