-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
48 lines (47 loc) · 972 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/** @type {import('ts-jest').JestConfigWithTsJest} */
const baseConfig = {
preset: 'ts-jest',
moduleFileExtensions: [
'js',
'jsx',
'ts',
'tsx',
'json',
],
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'^main/(.*)$': '<rootDir>/src/main/$1',
'^@/(.*)$': '<rootDir>/src/renderer/$1',
'^shim/(.*)$': '<rootDir>/src/shim/$1',
},
setupFilesAfterEnv: [
'./scripts/setup-jest.ts',
],
testEnvironmentOptions: {
url: 'http://localhost/',
},
transform: {
'\\.(ts|tsx|js|jsx)$': 'ts-jest',
},
maxWorkers: 1,
};
module.exports = {
projects: [
{
...baseConfig,
displayName: 'main',
testEnvironment: 'node',
testMatch: [
'<rootDir>/src/main/**/*.test.ts',
],
},
{
...baseConfig,
displayName: 'renderer',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/src/renderer/**/*.test.ts',
],
},
],
};