mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
module.exports = {
|
|
preset: "ts-jest",
|
|
testEnvironment: "jsdom",
|
|
roots: ["<rootDir>/src"],
|
|
transform: {
|
|
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest",
|
|
},
|
|
moduleNameMapper: {
|
|
"\\.svg$": "<rootDir>/__mocks__/svg.js",
|
|
"^@/(.*)$": "<rootDir>/src/$1",
|
|
"^obsidian$": "<rootDir>/__mocks__/obsidian.js",
|
|
// The yaml package's "exports" field defaults to a browser ESM entry under
|
|
// jsdom; Jest can't parse ESM without extra config, so point at the CJS
|
|
// build it ships under dist/.
|
|
"^yaml$": "<rootDir>/node_modules/yaml/dist/index.js",
|
|
"^@agentclientprotocol/sdk$": "<rootDir>/__mocks__/@agentclientprotocol/sdk.js",
|
|
"^@anthropic-ai/claude-agent-sdk$": "<rootDir>/__mocks__/@anthropic-ai/claude-agent-sdk.js",
|
|
// react-resizable-panels is ESM-only with no CJS build to point at; stub it.
|
|
"^react-resizable-panels$": "<rootDir>/__mocks__/react-resizable-panels.js",
|
|
},
|
|
testRegex: ".*\\.test\\.(jsx?|tsx?)$",
|
|
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
|
|
testPathIgnorePatterns: ["/node_modules/"],
|
|
setupFiles: ["<rootDir>/jest.setup.js"],
|
|
};
|