Skip to content

Keep runCLI argv consistent with Rsbuild, Rslib, and Rslint #1789

Description

@chenjiahan

#1729 changes runCLI({ argv }) from accepting the full Node.js process.argv array to accepting only process.argv.slice(2).

This diverges from Rsbuild, Rslib, Rslint, and Rstest 0.11.x, which all accept the full array:

// Previous Rstest contract; also used by Rsbuild, Rslib, and Rslint
runCLI({ argv: ['node', 'rstest', 'run', 'foo.test.ts'] });

// New Rstest contract
runCLI({ argv: ['run', 'foo.test.ts'] });

Existing integrations that still pass the full array now have the Node executable and script name interpreted as test filters, causing No test files found. This affected Rstest ecosystem CI and required an entry-specific workaround in rstackjs/rstack-cli#462, after rstackjs/rstack-cli#460 adapted to the relocated export. The unchanged argv: string[] type does not catch this mismatch.

Could we preserve the full process.argv contract when moving runCLI to @rstest/core/api? The new implementation already prepends ['node', 'rstest'] internally, so changing the public argument format does not appear necessary for the API rewrite. Keeping the existing contract would preserve compatibility and consistency across the Rstack tools.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions