test(globals): add unit tests for global CLI flag state helpers#96735
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 8:39 PM ET / 00:39 UTC. Summary PR surface: Tests +130. Total +130 across 1 file. Reproducibility: not applicable. this is a test-only coverage PR rather than a reported runtime bug. The relevant check is source inspection plus the PR-body terminal output for the helper probe and targeted test run. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Merge the focused helper coverage after maintainer acceptance and required exact-head checks; no runtime, config, or docs change is needed. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a test-only coverage PR rather than a reported runtime bug. The relevant check is source inspection plus the PR-body terminal output for the helper probe and targeted test run. Is this the best way to solve the issue? Yes: colocated Vitest unit coverage is the narrowest maintainable solution for these pure helpers. Existing broader logger tests remain intact, and the PR does not add a duplicate runtime path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 455f813d6ee6. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +130. Total +130 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Add unit tests for shouldLogVerbose, logVerbose, and logVerboseConsole functions in src/globals.ts to verify verbose logging behavior. Tests cover: - shouldLogVerbose returns true when isVerbose is true - shouldLogVerbose returns true when file log level is debug - shouldLogVerbose returns false when both are false - logVerbose does not log when shouldLogVerbose is false - logVerbose logs to console when isVerbose is true - logVerboseConsole does not log when isVerbose is false - logVerboseConsole logs to console when isVerbose is true
deb8e78 to
c4bb416
Compare
|
Merged via squash.
|
…claw#96735) * test(globals): add unit tests for global CLI flag state helpers Add unit tests for shouldLogVerbose, logVerbose, and logVerboseConsole functions in src/globals.ts to verify verbose logging behavior. Tests cover: - shouldLogVerbose returns true when isVerbose is true - shouldLogVerbose returns true when file log level is debug - shouldLogVerbose returns false when both are false - logVerbose does not log when shouldLogVerbose is false - logVerbose logs to console when isVerbose is true - logVerboseConsole does not log when isVerbose is false - logVerboseConsole logs to console when isVerbose is true * ci: trigger re-review * test(globals): cover verbose logger behavior --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…claw#96735) * test(globals): add unit tests for global CLI flag state helpers Add unit tests for shouldLogVerbose, logVerbose, and logVerboseConsole functions in src/globals.ts to verify verbose logging behavior. Tests cover: - shouldLogVerbose returns true when isVerbose is true - shouldLogVerbose returns true when file log level is debug - shouldLogVerbose returns false when both are false - logVerbose does not log when shouldLogVerbose is false - logVerbose logs to console when isVerbose is true - logVerboseConsole does not log when isVerbose is false - logVerboseConsole logs to console when isVerbose is true * ci: trigger re-review * test(globals): cover verbose logger behavior --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…claw#96735) * test(globals): add unit tests for global CLI flag state helpers Add unit tests for shouldLogVerbose, logVerbose, and logVerboseConsole functions in src/globals.ts to verify verbose logging behavior. Tests cover: - shouldLogVerbose returns true when isVerbose is true - shouldLogVerbose returns true when file log level is debug - shouldLogVerbose returns false when both are false - logVerbose does not log when shouldLogVerbose is false - logVerbose logs to console when isVerbose is true - logVerboseConsole does not log when isVerbose is false - logVerboseConsole logs to console when isVerbose is true * ci: trigger re-review * test(globals): cover verbose logger behavior --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…claw#96735) * test(globals): add unit tests for global CLI flag state helpers Add unit tests for shouldLogVerbose, logVerbose, and logVerboseConsole functions in src/globals.ts to verify verbose logging behavior. Tests cover: - shouldLogVerbose returns true when isVerbose is true - shouldLogVerbose returns true when file log level is debug - shouldLogVerbose returns false when both are false - logVerbose does not log when shouldLogVerbose is false - logVerbose logs to console when isVerbose is true - logVerboseConsole does not log when isVerbose is false - logVerboseConsole logs to console when isVerbose is true * ci: trigger re-review * test(globals): cover verbose logger behavior --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
What Problem This Solves
The
globals.tsmodule provides global CLI flag state helpers for verbose logging. However, this module lacked unit tests to verify the verbose logging behavior, which could lead to regressions when the function is modified.Why This Change Was Made
Add unit tests for
shouldLogVerbose,logVerbose, andlogVerboseConsolefunctions to verify verbose logging behavior. This improves test coverage and prevents regressions.Focused tests cover verbose flag checking, logger integration, and console output behavior.
User Impact
Global CLI flag state helpers now have comprehensive test coverage, reducing the risk of regressions when the function is modified.
Evidence
Reproducibility: not applicable. This PR adds direct coverage for existing helper behavior rather than reporting a user-visible runtime bug. Source inspection confirms the helper behavior the tests target.
Direct behavior probe:
Targeted test:
Formatting:
Whitespace:
AI-assisted
Prepared with Codex. I reviewed the change, understand the touched code path, and kept the PR focused on the bug described above.