node:test: report t.test() after parent finished as a parentAlreadyFinished failure - #34583
Open
robobun wants to merge 10 commits into
Open
node:test: report t.test() after parent finished as a parentAlreadyFinished failure#34583robobun wants to merge 10 commits into
robobun wants to merge 10 commits into
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
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`).
Loading