test: route every stdout/stderr write swap through stream-capture
Merged
TH
2d ago+409+409+012345678901234567890123456789-604-604-012345678901234567890123456789
What
Makes stream-capture.ts the one place that changes process.stdout.write / process.stderr.write (done-check: git grep -E 'std(out|err)\.write =|vi\.spyOn\(process\.(stdout|stderr), .write.\)' is empty outside the helper and its own leak test).
- Deletes
captureStderrfromdaemon-http-fixture.ts(its restore assigned a bound copy, leaving an own-property shadow for the rest of the file); callers usebeginStdoutCapture/beginStderrCapture. - Migrates every hand-rolled swap:
generic/screenshotstdout captures, the scripts lanes (check-affected,coverage-changed,coverage-crapincl. the new blocking-suitecapture()helper,fuzz/worker.tsvia thediscardoption, help-conformance sample producers). - Migrates all seven
vi.spyOn(process.stdout|stderr, 'write')sites (per review): a spyOn write fake has the same own-property leak shape as the assignment swaps. - Slims the helper surface:
beginStdoutCapture/beginStderrCaptureare the primitives; scopedwith*forms derive from them;withInteractiveStderr(Async)fold into{ interactive: true };withStreamTtyAsyncis deleted.
Verification
- Head
4a723e346, 33 files, +409/−604 (1,013 gross; the 13-line overshoot is retiring the three deadAPPROVED_OVER_CEILINGrows #3483 left onmain, which keeps the blocking Coverage job green). - Full unit lane (13,397 tests), scripts
node:testlanes,fuzz:parsers, harness, andcheck:affected --runall green locally.
Closes #3421