File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ module.exports = {
1111 testPathIgnorePatterns : [ '/node_modules/' , '/dist/' ] ,
1212 moduleNameMapper : {
1313 '^../../../src/(.*)$' : '<rootDir>/src/$1' ,
14- // @modelcontextprotocol /sdk and @langchain /core are ESM-only packages .
15- // They cannot be require()'d in Jest's CJS environment and crash the worker.
14+ // @modelcontextprotocol /sdk is ESM-only (type:module, no exports map, no CJS builds) .
15+ // It cannot be require()'d in Jest's CJS environment and crashes the worker.
1616 // The MCP core tests only exercise pure validation functions that don't
1717 // use these imports, so stubbing them out is safe.
18- '^@modelcontextprotocol/sdk/(.*)$' : '<rootDir>/test/__mocks__/esm-stub.js' ,
19- '^@langchain/core/(.*)$' : '<rootDir>/test/__mocks__/esm-stub.js'
18+ // Note: @langchain /core is NOT stubbed here because it ships CJS builds
19+ // (e.g. tools.cjs) that Jest can require() normally.
20+ '^@modelcontextprotocol/sdk/(.*)$' : '<rootDir>/test/__mocks__/esm-stub.js'
2021 }
2122}
You can’t perform that action at this time.
0 commit comments