Skip to content

fix(@angular/build): report the failing sequence sub-option in runner args errors - #34735

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/unit-test-sequence-value-errors
Open

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/unit-test-sequence-value-errors

Conversation

@MeAkib

@MeAkib MeAkib commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

The runnerArgs validation reports every invalid value for the --sequence option with a single message that only lists the supported sub-option names: --sequence.seed=-1 fails with 'The Vitest "--sequence" option requires only the following options: "--sequence.shuffle", "--sequence.seed".' although the user already used one of those options, and nothing states the actual value requirement.

Report each failing sub-option individually, matching the phrasing used for top-level options: an unknown name such as --sequence.concurrent is reported as not supported alongside the accepted names, and an invalid value such as --sequence.seed=-1 is reported with the sub-option's own value requirement.

An invalid --sequence.shuffle value is not testable through the real Vitest parser, which types the option as a boolean flag and treats a provided value as a test file filter.

… args errors

The `runnerArgs` validation reports every invalid value for the
`--sequence` option with a single message that only lists the supported
sub-option names: `--sequence.seed=-1` fails with 'The Vitest
"--sequence" option requires only the following options:
"--sequence.shuffle", "--sequence.seed".' although the user already
used one of those options, and nothing states the actual value
requirement.

Report each failing sub-option individually, matching the phrasing used
for top-level options: an unknown name such as `--sequence.concurrent`
is reported as not supported alongside the accepted names, and an
invalid value such as `--sequence.seed=-1` is reported with the
sub-option's own value requirement.

An invalid `--sequence.shuffle` value is not testable through the real
Vitest parser, which types the option as a boolean flag and treats a
provided value as a test file filter.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves error reporting for Vitest runner arguments by introducing specific error messages for invalid nested options under the --sequence flag. It adds an invalidMessages callback to the option configuration and updates the argument parser and tests accordingly. The feedback suggests explicitly excluding arrays when checking for objects in both isValid and invalidMessages to prevent arrays from being processed as plain objects, which could lead to incorrect validation or confusing error messages.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant