forked from EXXETA/trufos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
37 lines (36 loc) · 975 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
/** @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',
'^monaco-editor$': '<rootDir>/node_modules/@monaco-editor/react',
},
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'],
},
],
};