Repository navigation
test(cli-framework): specify terminal capabilities in hyperlink tests - #9664
PresentJay wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
table() decided on OSC 8 links by reading process.stdout.isTTY and TERM itself, so its tests depended on the runner. A runner with TERM=dumb printed plain URLs and failed the link tests. table() now takes the terminal as an optional last parameter. It defaults to the real stdout and TERM, so callers do not change. The tests state the terminal they test, and keep one dumb-terminal case. The cause was found in #9664.
What & why
The hyperlink tests set stdout to a TTY but inherit TERM. Under TERM=dumb the formatter correctly emits plain text and two assertions fail. Set the terminal type explicitly for the table tests, restore the caller’s environment afterward, and exercise plain URLs on a dumb TTY.
How I tested it
bun test src/output.test.ts— 15 pass, 0 fail.Checklist
Summary by cubic
Makes hyperlink table tests deterministic by setting the terminal type explicitly instead of inheriting
TERMfrom the environment.TERM=xterm-256colorfor table tests and restores the caller's environment afterward.TERM=dumb.Written for commit 8575bf5. Summary will update on new commits.
Summary by CodeRabbit