Remove fragile --test-args parsing, pass unknown args directly to vitest#42
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Free review on us!CodeRabbit is offering free reviews until Fri Nov 07 2025 to showcase some of the refinements we've made. Comment |
Co-authored-by: danelkay93 <24777308+danelkay93@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the argument handling in the agent-check.mjs script by removing the explicit --test-args flag and instead treating all unrecognized arguments as passthrough arguments for Vitest. This makes the CLI more intuitive and follows standard npm argument passing conventions.
Key Changes:
- Removed the
--test-args=flag parsing logic - Changed unknown argument handling from erroring to passthrough
- Updated help text to reflect the new argument passing pattern
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Treat unknown arguments as passthrough args for vitest | ||
| passthroughArgs.push(arg); |
There was a problem hiding this comment.
Handle
-- separator instead of forwarding it to Vitest
The new parsing loop now pushes every unrecognized token into passthroughArgs, including the literal --. When running QA with both script flags and Vitest flags (e.g. npm run qa -- --skip-build -- --grep "pattern"), the loop forwards ['--', '--grep', 'pattern'] and line 55 prepends another --. vitest therefore receives npm run test:unit -- -- --grep pattern --passWithNoTests, where the second -- stops option parsing and all subsequent flags (--grep, --passWithNoTests, etc.) are ignored. Custom test arguments no longer work and the safety flag --passWithNoTests is lost whenever passthrough args are used. The parser should treat -- as a separator (stop parsing and exclude it) before building testArgs.
Useful? React with 👍 / 👎.
af14def
into
codex/optimize-bleedy-environment-configuration
The
--test-args=implementation split values by spaces, breaking arguments containing spaces even when quoted (e.g.,--grep "test pattern").Changes
--test-args=special handling and error on unknown optionsBefore/After
Arguments now rely on shell's native parsing instead of custom string splitting.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.