Skip to content

Commit 936f50d

Browse files
author
christopherholland-workday
committed
Fix test coverage failures
1 parent 1bfb836 commit 936f50d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/components/jest.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)