test(tui): cover externalCli launchHermesCommand spawn shape - #22296
Closed
wesleysimplicio wants to merge 1 commit into
Closed
test(tui): cover externalCli launchHermesCommand spawn shape#22296wesleysimplicio wants to merge 1 commit into
wesleysimplicio wants to merge 1 commit into
Conversation
Add 8 vitest cases for launchHermesCommand:
- default 'hermes' binary with stdio inherit
- HERMES_BIN env override
- whitespace trimming
- empty/whitespace fallback to default
- exit code 0 / non-zero
- spawn error -> {code: null, error}
- args passthrough
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Vitest coverage for launchHermesCommand in ui-tui/src/lib/externalCli.ts, exercising how the helper selects the Hermes binary and how it resolves its result based on child-process events.
Changes:
- Added a new test suite validating default spawn behavior (
hermes,stdio: 'inherit') and argument passthrough. - Added tests covering
HERMES_BINoverride behavior, including trimming and whitespace-only fallback. - Added tests for resolution shape on
exit(0 and non-zero) and onerrorevents.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Closing non-fix PR as requested — mantendo apenas PRs de fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
test(tui): cover externalCli launchHermesCommand spawn shape
Root cause
The detailed rationale from the original PR body is preserved below. This template update keeps the review structure consistent with #29640.
Fix
Why this shape
This shape mirrors #29640 so reviewers can quickly compare scope, root cause, fix, tests, and related context without having to decode a custom PR description.
Tests
Original body
Related PRs / issues
Original body
Summary
test(tui): cover externalCli launchHermesCommand spawn shape
What Changed
Fluxo
A mudança continua seguindo o fluxo original descrito na seção preservada abaixo, sem ampliar o escopo funcional deste PR.
Visão
A padronização melhora a revisão, reduz ruído e evita deriva de formatação entre PRs abertos.
Test Plan
Original body
Summary
Add 8 vitest cases for the previously untested
launchHermesCommandhelper inui-tui/src/lib/externalCli.ts.Coverage
hermesbinary withstdio: 'inherit'HERMES_BINenv overrideHERMES_BINHERMES_BINis empty/whitespace-only{ code: 0 }on clean exit{ code: null, error }on spawn error eventTest plan
npx vitest run src/__tests__/externalCli.test.ts(8/8 passed)npx vitest run(662/662 passed across 63 files)Generated by Hermes Turbo
Generated by Hermes Turbo