logancyang_obsidian-copilot/jest.config.js
Zero Liu d8dfaa6c6b
feat(agent-home): surface Relevant Notes as a shelf tab (#2668)
* Revert "Revert "feat(agent-home): surface Relevant Notes as a home-shelf tab …"

This reverts commit 982a2462f4.

* fix(agent-home): size relevant notes shelf correctly

* fix(agent-home): address relevant notes review feedback

* test(relevant-notes): cover shelf navigation leaf selection

* fix(relevant-notes): always open notes in new tabs
2026-07-20 21:25:59 -04:00

29 lines
1.4 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",
// @orama/orama resolves to its ESM "browser" entry under jsdom, which Jest
// can't parse; point at the CJS build it ships under dist/commonjs/ (same
// reason as yaml above).
"^@orama/orama$": "<rootDir>/node_modules/@orama/orama/dist/commonjs/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"],
};