Skip to content

feat(cli): add --repeats CLI option - #10504

Merged
sheremet-va merged 1 commit into
vitest-dev:mainfrom
todor-a:feat-repeats-cli
Jun 7, 2026
Merged

sheremet-va merged 1 commit into
vitest-dev:mainfrom
todor-a:feat-repeats-cli

Conversation

@todor-a

@todor-a todor-a commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Exposes the test repeats option as a CLI argument (--repeats <number>) and config option, mirroring retry. Resolves #7352.

Builds on the stale #9250 and addresses its review feedback:

  • Applies the config default during collection (packages/runner/src/suite.ts: options.repeats ?? runner.config.repeats) so testCase.options.repeats reflects the config value instead of being forced to 0. A per-test repeats option still takes precedence. (run.ts is left unchanged, per the maintainer's note.)
  • Uses the maintainer-suggested wording for the CLI/docs descriptions.
  • Adds repeats to the project-config override allowlist in resolveProjects.ts, which feat(cli): add --repeats to the cli options #9250 missed — without it --repeats did not reach workspace/project configs (covered by a new test).

Tests

  • test/e2e/test/repeats.test.ts — config repeats propagates to testCase.options.repeats and the test actually repeats; per-test option overrides config.
  • test/e2e/test/cli-config.test.ts — --repeats inherited from the CLI into the resolved (project) config.

This PR was prepared with AI assistance.


@github-actions github-actions Bot added the maybe automated User is likely an AI agent, or the content was generated by an AI assistant without user control label Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Hello @todor-a. Your PR has been labeled maybe automated because it appears to have been fully generated by AI with no human involvement.

To keep your PR open, please follow these steps:

  • Confirm that you are a real human. If you are an automated agent, disclose that
  • Confirm you've read, reviewed and stand behind its content
  • Confirm you've read the full issue along with all of its comments, as well as any linked issues and their comments
  • Make sure it follows our contribution guidelines and uses the correct GitHub template
  • Disclose any AI tools you used (e.g. Claude, Copilot, Codex)

Please, do not generate or format the response with AI. If you do not speak English, reply in your native language or use translation software like Google Translate or Deepl. If the response is generated, the PR will be closed automatically.

These measures help us reduce maintenance burden and keep the team's work efficient. See our AI contributions policy for more context.

@netlify

netlify Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7829dab
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a239a514c20640008d04953
😎 Deploy Preview https://deploy-preview-10504--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@todor-a

todor-a commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Hello @todor-a. Your PR has been labeled maybe automated because it appears to have been fully generated by AI with no human involvement.

To keep your PR open, please follow these steps:

  • Confirm that you are a real human. If you are an automated agent, disclose that
  • Confirm you've read, reviewed and stand behind its content
  • Confirm you've read the full issue along with all of its comments, as well as any linked issues and their comments
  • Make sure it follows our contribution guidelines and uses the correct GitHub template
  • Disclose any AI tools you used (e.g. Claude, Copilot, Codex)

Please, do not generate or format the response with AI. If you do not speak English, reply in your native language or use translation software like Google Translate or Deepl. If the response is generated, the PR will be closed automatically.

These measures help us reduce maintenance burden and keep the team's work efficient. See our AI contributions policy for more context.

Hey. Yes, I am a real human. I've disclosed that the use of AI in the description (Claude Code). I would love for this cli flag to be available and I saw that the other PR is stale so I decided to create a new one.

@sheremet-va sheremet-va removed the maybe automated User is likely an AI agent, or the content was generated by an AI assistant without user control label Jun 2, 2026
sheremet-va
sheremet-va previously approved these changes Jun 2, 2026
Exposes the test `repeats` option as a CLI argument and config option,
mirroring `retry`. The config value is applied during collection so
`testCase.options.repeats` reflects it, and a per-test `repeats` option
takes precedence.
@sheremet-va
sheremet-va merged commit ee48b95 into vitest-dev:main Jun 7, 2026
16 of 18 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose repeats as a cli argument

2 participants