Repository navigation
Conversation
'rtk jest --reporters default' stripped only the --reporters token, leaving 'default' behind as a positional test-name filter, so jest silently ran the wrong (usually empty) test set. Same bug class as the playwright fix in rtk-ai#3572, but jest's --reporters is a greedy yargs array flag in BOTH the space and equals forms: every following non-flag token is a reporter value and must be dropped with the flag. The singular --reporter (not a jest flag) binds at most one value under yargs unknown-option rules and is consumed accordingly. Replace the prefix-only matching with exact flag names: --watch and --watchAll are boolean and no longer swallow --watchman, and --watchPathIgnorePatterns <value> is forwarded intact instead of having its flag stripped and its value leaked as a filter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Oct 3, 2026
2 tasks done
This was referenced Oct 9, 2026
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.
Sibling of #3572 (playwright), same bug class on the jest path.
Bug:
rtk jest --reporters defaultstrips only the--reporterstoken in the arg-forwarding loop (src/cmds/js/vitest_cmd.rs), leavingdefaultbehind as a positional test-name filter — jest silently runs the wrong (usually empty) test set.Fix: replace the prefix-only strip with a helper that consumes exactly the tokens jest's own yargs parsing would bind, verified against jest 30 (
jest-clideclaresreportersastype: 'array'with default greedy-arrays):--reportersand--reporters=<v>are both greedy: every following non-flag token is a reporter value and is dropped with the flag (real jest:--reporters=default otherfails with "Could not resolve a module for a custom reporter. Module name: other").--reporter(not a jest flag) binds at most one value under yargs unknown-option rules; only that token is consumed.--reporter=<v>binds none.--watch/--watchAllare boolean and now matched exactly — the oldstarts_with("--reporter")/starts_with("--watch")prefix match swallowed--watchmanand stripped--watchPathIgnorePatternswhile leaking its value as a filter (the same positional-leak bug). Both forward intact now.--and everything after it are forwarded verbatim (jest treats all following tokens as positionals).Tests: 12 unit tests covering the space form, greedy equals form, array-value consumption, flag boundary, singular-reporter one-value binding, boolean watch flags, value-carrying watch flags forwarded,
run/--json, trailing flag without value, and the--terminator (both position and post---verbatim forwarding).Gate:
cargo fmt --allclean,cargo clippy --all-targetsclean,cargo test --allgreen (2842 passed).🤖 Generated with Claude Code