Skip to content

node:test: report t.test() after parent finished as a parentAlreadyFinished failure - #34583

Open
robobun wants to merge 10 commits into
mainfrom
claude/farm-7db298bf-node-test-late-subtest-failure
Open

node:test: report t.test() after parent finished as a parentAlreadyFinished failure#34583
robobun wants to merge 10 commits into
mainfrom
claude/farm-7db298bf-node-test-late-subtest-failure

address review: mirror --bail check after late-subtest fail increment

034a983
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 18, 2026 in 15m 42s

Code review found 2 potential issues

Found 1 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js/node/test.ts:1659-1669 runLateSubtest skips post-body cleanup (t.mock reset, after hooks)

Annotations

Check warning on line 1669 in src/js/node/test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

runLateSubtest skips post-body cleanup (t.mock reset, after hooks)

`runLateSubtest` runs the late body but never calls `child.mockTracker?.reset()` (or iterates `child.hooks.after`) afterward, unlike the sibling body-running path `executeTestNode` which does both unconditionally. A late body that does `t.mock.method(sharedObj, ...)` now leaves the mock installed for every remaining test in the file — a regression from pre-PR Bun (which never ran the body) and a divergence from Node (whose `postRun()` calls `this.mock?.reset()` even for `parentAlreadyFinished`).