docs/solutions/test-failures/2026-03-24-test-fast-must-isolate-helper-driven-bun-module-mocks.md
bun tooling/scripts/test-fast.mjs was still failing in the shared batch even after isolating specs that directly contained mock.module(.
The ugly part was that the visible failures showed up far away from the cause:
layout transforms started seeing nodes without childrendiff tests started picking up stray id: 'node'BlockPlaceholderPlugin saw editor.dom as undefinedThose were not 142 product bugs. They were suite pollution.
The runner only checked each spec file's own source for mock.module(.
That missed specs like:
That spec looked clean, but it imported:
And that helper registered multiple top-level mock.module(...) calls.
So the spec stayed in the shared batch, leaked module mocking into unrelated tests, and made the full suite fail in nonsense places.
Update test-fast.mjs so isolation is based on the local import graph, not just the spec file body.
The runner now:
import, export ... from, dynamic import(...), and require(...)mock.module(That catches helper-driven mocks like tocHookMocks.ts and keeps those specs out of the shared batch.
If Bun module mocks can live in helper files, test-runner isolation must follow local imports.
Scanning only the spec file body is too naive and will lie to you.