inspector/scripts/lib
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall e15dd8abee fix(scripts): make the test stubs drain, and the raw-mode guard testable (#2147)
Copilot review round 5 — four findings, all in the suppressed block.

1+4. The regression stubs did `console.log(MARKER); process.exit(1)`.
     Writing to a PIPE is asynchronous and `process.exit()` tears the
     process down without draining, so the marker can be lost outright —
     and then the stub that pins the paint-then-die path fails as "exited
     before rendering", the neighbouring branch and the wrong diagnostic
     for the thing it guards.

     Worth recording that I met this mechanism last round and did not join
     the dots: probing the drain race, a 4MB write followed by
     `process.exit()` reached the parent with the marker missing
     entirely. That was noted as a reason the repro failed, while the same
     construct stayed in the stubs. Both now set `process.exitCode` and
     let the loop drain — still exiting immediately after the write — with
     a comment, since `process.exit()` is the more obvious spelling and
     will read as a simplification to the next person. Same fix for the
     `console.error("boom")` stub, whose assertion had the same exposure.

2.   DEFAULTS claimed "every one is a hard floor as well as a default",
     which contradicts `normalizeMs` (any finite positive value passes)
     and the suite two files over, which passes 400ms against a 2000ms
     default. It rejects the shape a bad env var produces, not smallness.

3.   The raw-mode forbidden-output check was unreachable from any test:
     the real PTY happy path only exercises the pattern NOT matching, so
     a regression breaking it would stay green forever — an
     acceptance-criterion guard with nothing guarding it, which is the
     recursive form of this PR's own complaint.

     Now a `runRenderSmoke` option (`forbidOutput`), so it runs inside the
     tested state machine and against the fully drained output.
     `smoke:tui` passes its pattern in and drops the post-hoc check. It
     can only turn a pass into a failure, never rewrite an existing
     failure's message: a crash reason is more useful than "and it also
     printed X", which is usually a symptom of that crash. Three tests —
     matching, not matching, and that asymmetry.

Verified: test:scripts 213/213; `smoke:tui OK — rendered "MCP Servers" at
360ms and was still running 2000ms later`; and the no-PTY shim still
fails through the refactored path.

Signed-off-by: Cliff Hall <cliff@futurescale.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-26 22:13:35 -04:00
..
announced-child.mjs fix(scripts): observe the final polling interval before declaring a timeout 2026-08-23 13:02:38 -04:00
announced-child.test.mjs fix(scripts): observe the final polling interval before declaring a timeout 2026-08-23 13:02:38 -04:00
child-cleanup.mjs fix(scripts): await the pack:verify web child's exit before removing its work dir (#1895) 2026-08-01 19:50:00 -04:00
child-cleanup.test.mjs fix(scripts): await the pack:verify web child's exit before removing its work dir (#1895) 2026-08-01 19:50:00 -04:00
ensure-test-servers.mjs docs(scripts): correct the deleted-source caveat — it is silent, not loud 2026-08-25 01:37:40 -04:00
ensure-test-servers.test.mjs fix(scripts): pin the tsbuildinfo inside build/, assert on cache hits 2026-08-25 01:11:10 -04:00
headless-browser.mjs fix(smoke): assert the requested engine is the one launched; fix the remedy 2026-08-26 09:33:21 -04:00
headless-browser.test.mjs fix(smoke): assert the requested engine is the one launched; fix the remedy 2026-08-26 09:33:21 -04:00
mcp-app-flow.mjs test(smoke): run the headless web smokes in Firefox and WebKit, not just Chromium (#2086) 2026-08-25 20:44:11 -04:00
mcp-app-flow.test.mjs Merge branch 'v2/main' into v2/chore/2003-pack-verify-app-render 2026-08-24 09:05:53 -04:00
npm-scripts.mjs test(cli,tui): typecheck the __tests__ dirs (#1791) (#1799) 2026-07-27 12:05:35 -04:00
npm-scripts.test.mjs test(cli,tui): typecheck the __tests__ dirs (#1791) (#1799) 2026-07-27 12:05:35 -04:00
prod-web-server.mjs test(smoke): cover loadBrowser's failure branches; fix a stale helper comment 2026-08-25 22:42:06 -04:00
prod-web-server.test.mjs fix(smoke): pin the teardown ordering, and correct a docblock the test refuted 2026-08-11 15:17:56 -04:00
pty.mjs fix(scripts): address Copilot review round 2 on #2147 2026-08-26 21:36:40 -04:00
pty.test.mjs fix(scripts): address Copilot review round 2 on #2147 2026-08-26 21:36:40 -04:00
render-smoke.mjs fix(scripts): make the test stubs drain, and the raw-mode guard testable (#2147) 2026-08-26 22:13:35 -04:00
render-smoke.test.mjs fix(scripts): make the test stubs drain, and the raw-mode guard testable (#2147) 2026-08-26 22:13:35 -04:00
resolve-node-bin.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00
resolve-node-bin.test.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00
tsc-program.mjs fix(scripts): validate the bin name and that its file exists 2026-08-16 23:43:24 -04:00
tsc-program.test.mjs chore(scripts): compare only the copies a program actually met 2026-08-16 12:35:38 -04:00
win-shell-args.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00
win-shell-args.test.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00