-
Notifications
You must be signed in to change notification settings - Fork 315
Expand file tree
/
Copy pathjest.config.js
More file actions
25 lines (25 loc) · 1.25 KB
/
Copy pathjest.config.js
File metadata and controls
25 lines (25 loc) · 1.25 KB
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
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
setupFiles: ["<rootDir>/jest.setup.js"],
testPathIgnorePatterns: ["/node_modules/", "/src/integration/"],
moduleNameMapper: {
"^src/(.*)": "<rootDir>/src/$1",
// More specific pattern must come first — "obsidian" is a regex that would
// otherwise match "obsidian-daily-notes-interface" too.
"obsidian-daily-notes-interface": "<rootDir>/mocks/obsidian-daily-notes-interface.ts",
"^obsidian$": "<rootDir>/mocks/obsidian.ts",
// Marked is ESM-only; point Jest at the UMD build so CommonJS transforms work.
"^marked$": "<rootDir>/node_modules/marked/lib/marked.umd.js",
// Jest 27 doesn't support package.json exports maps, so deep .js paths in the
// MCP SDK (e.g. @modelcontextprotocol/sdk/server/mcp.js) must be resolved
// explicitly to the CJS dist. Tests that load McpHandler mock the SDK classes
// directly so the ESM-only zod internals bundled with the SDK are never touched.
"^@modelcontextprotocol/sdk/(.+)\\.js$":
"<rootDir>/node_modules/@modelcontextprotocol/sdk/dist/cjs/$1.js",
},
transform: {
"\\.ts$": ["ts-jest", { tsconfig: "tsconfig.test.json", diagnostics: false }],
"\\.ya?ml$": "<rootDir>/jest-raw-transformer.js",
},
};