-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.basic.js
More file actions
35 lines (33 loc) · 839 Bytes
/
Copy pathjest.config.basic.js
File metadata and controls
35 lines (33 loc) · 839 Bytes
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
import * as path from 'path';
import { fileURLToPath } from 'url';
const thisDir = fileURLToPath(new URL('.', import.meta.url));
export default {
preset: 'ts-jest',
clearMocks: true,
testEnvironment: 'node',
testMatch: ['<rootDir>/src/test/basic/**/!(*.d.ts)@(.ts)'],
moduleNameMapper: {
'^@/(.*)\\.js$': '<rootDir>/src/main/$1',
'^@/(.*)$': '<rootDir>/src/main/$1',
'(.+)\\.js': '$1',
},
extensionsToTreatAsEsm: ['.ts'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
useESM: true,
diagnostics: {
ignoreCodes: ['TS151001'],
},
},
],
},
globals: {
__TEST_PLATFORM__: 'any',
__TEST_INPUT_ROOT__: path.resolve(thisDir, 'test/input'),
__TEST_TEMPDIR_ROOT__: path.resolve(thisDir, '.work/test'),
__TEST_TOOL_ROOT__: path.resolve(thisDir, 'tools'),
},
};