retry
- Type:
number - Default:
0 - CLI:
--retry <times>
Retry a failing test a specified number of times, useful for handling flaky tests.
A single test can override this with TestOptions.retry, including { retry: 0 } to disable retries for one test even when this config is set.
Example
Set retry: 2 to retry a failed test up to two times:
When the test has retried, you may get the following logs:
- success:
- or failure: