mirror of
https://github.com/hanzoai/mcp.git
synced 2026-10-15 12:30:12 +00:00
Every suite had stopped executing. ts-jest peers on `typescript >=4.3 <7` and this repo builds against 7, so all twenty files died inside ConfigSet with "Cannot read properties of undefined (reading 'fileExists')" — twenty failures, zero tests, and nothing to read them by because the push gate deliberately runs typecheck and build rather than jest. swc transforms instead: it strips types rather than asking the compiler to, so it has no TypeScript version to disagree with, and `tsc --noEmit` already answers the question ts-jest was answering twice. Running as real ESM then exposed what the CommonJS fallback had hidden. jest.mock does not hoist there, so a static import binds the real module and the suite fails on `mockReturnValue is not a function` — an absent mock reported as a broken one. The search, autogui and ui suites now register through unstable_mockModule and import after it. One of them had never mocked fs at all: it cast fs.promises to a mocked type and called mockImplementation on the real module. 384 tests, twenty suites, all passing.