File size: 838 Bytes
2569bec | 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 | /** @type {import('jest').Config} */
module.exports = {
preset: "ts-jest/presets/default-esm",
testEnvironment: "node",
extensionsToTreatAsEsm: [".ts"],
setupFilesAfterEnv: ["<rootDir>/tests/setupCodexHome.ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
testMatch: ["**/tests/**/*.test.ts"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "tsconfig.json",
diagnostics: {
ignoreCodes: [1343],
},
astTransformers: {
before: [
{
path: "ts-jest-mock-import-meta",
// Workaround for meta.url not working in jest
options: { metaObjectReplacement: { url: "file://" + __dirname + "/dist/index.js" } },
},
],
},
},
],
},
};
|