Repository navigation
feat(cli): add --repeats to the cli options - #9250
Closed
michael-debs wants to merge 4 commits into
Closed
michael-debs wants to merge 4 commits into
michael-debs wants to merge 4 commits into
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
michael-debs
marked this pull request as ready for review
December 14, 2025 17:24
hi-ogawa
approved these changes
Jan 7, 2026
sheremet-va
requested changes
Jan 7, 2026
| const $ = runner.trace! | ||
|
|
||
| const repeats = test.repeats ?? 0 | ||
| const repeats = (test.repeats || runner.config.repeats) ?? 0 |
Member
There was a problem hiding this comment.
Suggested change
| const repeats = (test.repeats || runner.config.repeats) ?? 0 | |
| const repeats = test.repeats ?? runner.config.repeats ?? 0 |
Member
There was a problem hiding this comment.
Actually, I would add it somewhere here:
vitest/packages/runner/src/suite.ts
Line 325 in c23dd11
So that testCase.options.repeats is not 0
| - **Default:** `0` | ||
| - **CLI:** `--repeats=<number>` | ||
|
|
||
| Repeat the test a specific number of times regardless of the result. |
Member
There was a problem hiding this comment.
Suggested change
| Repeat the test a specific number of times regardless of the result. | |
| Repeat every test a specific number of times regardless of the result. |
| - **CLI:** `--repeats <number>` | ||
| - **Config:** [repeats](/config/repeats) | ||
|
|
||
| Repeat the test a specific number of times regardless of the result (default: `0`) |
Member
There was a problem hiding this comment.
Suggested change
| Repeat the test a specific number of times regardless of the result (default: `0`) | |
| Repeat every test a specific number of times regardless of the result (default: `0`) |
| argument: '<times>', | ||
| }, | ||
| repeats: { | ||
| description: 'Repeat the test a specific number of times regardless of the result (default: `0`)', |
Member
There was a problem hiding this comment.
Suggested change
| description: 'Repeat the test a specific number of times regardless of the result (default: `0`)', | |
| description: 'Repeat every test a specific number of times regardless of the result (default: `0`)', |
Contributor
|
Looking forward to this 👀 |
|
This would be very useful |
6 of 8 tasks
Collaborator
|
superseded by |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
This pull request exposes the repeat option of the test options to the cli
it will prioritize the test option value over the cli value for an individual test.
so if your code was:
it will output:

Resolves #7352
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.