-
-
Notifications
You must be signed in to change notification settings - Fork 743
Expand file tree
/
Copy pathjest.config.js
More file actions
35 lines (35 loc) · 1.7 KB
/
Copy pathjest.config.js
File metadata and controls
35 lines (35 loc) · 1.7 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
26
27
28
29
30
31
32
33
34
35
module.exports = {
preset: "ts-jest",
testEnvironment: "jsdom",
roots: ["<rootDir>/src", "<rootDir>/dev", "<rootDir>/scripts"],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest",
"^.+\\.md$": "<rootDir>/jest.textTransform.js",
},
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",
// @anthropic-ai/sdk publishes its lib/ entry points through an "exports"
// wildcard that Jest's resolver does not expand, so @langchain/anthropic's
// require of one fails to resolve. Point at the CJS build directly.
"^@anthropic-ai/sdk/lib/(.*)$": "<rootDir>/node_modules/@anthropic-ai/sdk/lib/$1.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", "md"],
testPathIgnorePatterns: ["/node_modules/"],
// Markdown shipped by the openartifacts package goes through the text transform above.
transformIgnorePatterns: [
"[/\\\\]node_modules[/\\\\](?!openartifacts[/\\\\])",
"\\.pnp\\.[^\\/]+$",
],
setupFiles: ["<rootDir>/jest.setup.js"],
};