Skip to content

fix(jest): only drop run when it's the first arg - #4442

Open
ragen1337 wants to merge 1 commit into
rtk-ai:developfrom
ragen1337:fix/jest-keep-run-flag-value
Open

ragen1337 wants to merge 1 commit into
rtk-ai:developfrom
ragen1337:fix/jest-keep-run-flag-value

Conversation

@ragen1337

Copy link
Copy Markdown

Summary

Heads up: #3777 still has the arg == "run" check, so whichever of the two lands second will need a small rebase.

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: put a fake jest on PATH that prints its args, rtk jest -t run src/ok.test.js now passes -t run src/ok.test.js through, rtk jest run src/ok.test.js still drops the leading run

3 tests (guard_integration_test x2 and one in rewrite_host_scoping) fail for me locally, but they fail on develop too, looks like my git version.

rtk jest removed every argument equal to `run`, so `rtk jest -t run
src/ok.test.js` spawned `jest -t src/ok.test.js`: the name pattern was
lost and the path filter became the pattern. Like the `jest run` rewrite
prefix, treat `run` as a subcommand only when it comes first.
@CLAassistant

CLAassistant commented Oct 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added bug Something isn't working rust jest labels Oct 4, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes a bug in the rtk jest command rewrite where any run argument (e.g. a flag value like -t run) was incorrectly stripped, not just a leading run subcommand. Now run is only dropped when it appears as the first argument, matching the behavior of the existing jest run rewrite rule.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #4431


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@ragen1337

Copy link
Copy Markdown
Author

Hi! Gentle ping on this small fix. Happy to rebase or add a test case if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working jest rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rtk jest drops a run argument anywhere in the line, so -t run loses its value

2 participants