ReviewOS

home-lang/home

Port mock.module require.resolve sibling TypeScript corpus

#122
Closed chris opened this 10 days ago ·
10 days ago

Tracks the focused port of Bun issue 6874 from the vendored corpus.

Scope:

  • activate byte-identical js/bun/test/mock/6874/A.test.ts and B.test.ts
  • resolve their byte-identical sibling A.ts/B.ts modules through Home's module bridge
  • support mock.module(require.resolve("lodash"), factory) with Bun-like resolved keys and persistent mocked module values
  • preserve live imported dependency behavior for the sibling TypeScript exports
  • add permanent exact-corpus regressions and keep the full home_test gate green

Parent tracker: #66

10 days ago

Implemented and pushed in ba2da37, with the integrated passing tip at 456898e.

All four Bun files in mock/6874 are byte-identical to the upstream corpus. The bridge now canonicalizes mock.module keys through require.resolve semantics, persists mocked factory results like cached modules, resets them on replacement, and provides live sibling TypeScript dependency lookup in the shared runtime. A permanent A/B regression exercises the two files together.

Exact results:

  • A.test.ts: 1 pass, 0 fail/todo/unsupported
  • B.test.ts: 1 pass, 0 fail/todo/unsupported

The linked ResolvedSource ABI blocker discovered during integration was fixed in #123. The full home_test gate then passed all 1,095 cases with the one expected skip and no failures. This advances the parent port in #66.

Sign in to comment on this issue.