-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjest.config.js
43 lines (41 loc) · 1.07 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
import preset from 'ts-jest/presets/index.js'
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
...preset.defaultsESM,
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
modulePathIgnorePatterns: ['lib', 'node_modules'],
testMatch: ['**/__tests__/**/*.test.ts'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
isolatedModules: true,
// tsconfig: 'tsconfig.json',
useESM: true,
},
],
},
}
// const config: JestConfigWithTsJest = {
// extensionsToTreatAsEsm: ['.ts'],
// moduleNameMapper: {
// '^(\\.{1,2}/.*)\\.js$': '$1',
// },
// preset: 'ts-jest/presets/default-esm',
// testEnvironment: 'node',
// testMatch: ['**/__tests__/**/*.test.ts'],
// modulePathIgnorePatterns: ['lib', 'node_modules'],
// transform: {
// // '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// // '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
// '^.+\\.tsx?$': [
// 'ts-jest',
// {
// useESM: true,
// },
// ],
// },
// };
// export default config;