Jest and Vitest hoist jest.mock and vi.mock calls above the import statements in a file, so the mock is registered before the module under test is ever evaluated. Bun's mock.module() has no such transform: it runs in source order, after every static import at the top of the file has already been resolved and executed.
A test that statically imports the module under test and then calls mock.module('./dep', ...) will therefore exercise the real dependency. The failure is quiet, because the mock is installed correctly and simply arrives too late for the already-captured binding.
Two patterns work. Call mock.module() first and then load the subject with a dynamic await import('./subject') inside the test. Or register mocks in a file listed under preload in bunfig.toml, which runs before any test file. Bun does re-evaluate the module registry when mock.module is called, so already-imported modules pick up the mock for subsequent imports, but not for bindings already destructured.