ReviewOS

home-lang/home

Bun parity: port mock functions and Jest spy matcher matrices

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

Scope

Port the unchanged upstream js/bun/test/mock-fn.test.js and js/bun/test/spyMatchers.test.ts suites to the Home bootstrap runner without TODO rewriting.

This tranche covers:

  • Jest-compatible mock function prototype, metadata, state replacement, call contexts, instances, invocation ordering, one-shot implementations, and withImplementation restoration
  • non-function jest.fn(value) return-value shorthand
  • idempotent function/data-property spying, descriptor restoration, and indexed property keys
  • incomplete recursive result tracking and return/call matcher semantics
  • positive and negated objectContaining support in nested matcher equality
  • permanent exact-count corpus regressions

Validation

  • mock-fn.test.js: 54 passed, 0 failed, 0 unsupported, 0 todo
  • spyMatchers.test.ts: 145 passed, 0 failed, 0 unsupported, 5 upstream-declared todo
  • neighboring mock/expect matrix: 37 passed, 0 failed, 0 unsupported, 0 todo
  • both activated fixtures are byte-identical to ~/Code/bun
  • full ./pantry/.bin/zig build test -Dfilter=home_test --summary failures gate passes

Tracked under #66.

10 days ago

Completed in ebe5f0127.

The unchanged upstream matrices now run natively in Home:

  • mock-fn.test.js: 54/54, 0 failed, 0 unsupported, 0 todo
  • spyMatchers.test.ts: 145/145, 0 failed, 0 unsupported, 5 upstream-declared todo preserved
  • neighboring mock/expect regressions: 37/37, 0 failed, 0 unsupported, 0 todo

Both activated fixtures are byte-identical to ~/Code/bun, permanent exact-count regressions are included, and the full home_test gate passes with zero failures.

Sign in to comment on this issue.