Repository navigation
Conversation
… 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.
There was a problem hiding this comment.
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.
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.
The
runnerArgsvalidation reports every invalid value for the--sequenceoption with a single message that only lists the supported sub-option names:--sequence.seed=-1fails 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.concurrentis reported as not supported alongside the accepted names, and an invalid value such as--sequence.seed=-1is reported with the sub-option's own value requirement.An invalid
--sequence.shufflevalue 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.