21 lines
592 B
JavaScript
21 lines
592 B
JavaScript
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
export default {
|
|
preset: "ts-jest/presets/default-esm", // important for ESM
|
|
testEnvironment: "node",
|
|
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
|
|
globals: {
|
|
"ts-jest": {
|
|
useESM: true, // enable ESM in ts-jest
|
|
tsconfig: "tsconfig.json",
|
|
},
|
|
},
|
|
extensionsToTreatAsEsm: [".ts"], // treat TypeScript files as ESM
|
|
moduleNameMapper: {
|
|
"^(\\.{1,2}/.*)\\.js$": "$1", // fix import extensions in ESM
|
|
},
|
|
transform: {
|
|
"^.+\\.tsx?$": ["ts-jest", { useESM: true }],
|
|
},
|
|
testTimeout: 50000,
|
|
};
|