codex / sdk /typescript /jest.config.cjs
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
2569bec verified
Raw History Blame Contribute Delete
838 Bytes
/** @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" } },
},
],
},
},
],
},
};