KC's Workspace
    Preparing search index...
    Retry:
        | number
        | {
            condition?: RegExp
            | ((error: TestError) => boolean);
            count?: number;
            delay?: number;
        }

    Retry configuration for tests. Can be a number for simple retry count, or an object for advanced retry control.

    Type Declaration

    • number
    • {
          condition?: RegExp | ((error: TestError) => boolean);
          count?: number;
          delay?: number;
      }
      • Optionalcondition?: RegExp | ((error: TestError) => boolean)

        Condition to determine if a test should be retried based on the error.

        • If a RegExp, it is tested against the error message
        • If a function, called with the TestError object; return true to retry

        NOTE: Functions can only be used in test files, not in vitest.config.ts, because the configuration is serialized when passed to worker threads.

        undefined (retry on all errors)
        
      • Optionalcount?: number

        The number of times to retry the test if it fails.

        0
        
      • Optionaldelay?: number

        Delay in milliseconds between retry attempts.

        0