diff --git a/packages/runner/src/suite.ts b/packages/runner/src/suite.ts index 7960913cd0a2..0061f3b095f6 100644 --- a/packages/runner/src/suite.ts +++ b/packages/runner/src/suite.ts @@ -77,7 +77,7 @@ function createSuiteCollector(name: string, factory: SuiteFactory = () => { }, m mode, suite: undefined!, fails: this.fails, - retry: options?.retry, + retry: options?.retry || runner.config.retry, repeats: options?.repeats, meta: Object.create(null), } as Omit as Test diff --git a/packages/runner/src/types/runner.ts b/packages/runner/src/types/runner.ts index 1f79b96f1f79..207d5e6547ca 100644 --- a/packages/runner/src/types/runner.ts +++ b/packages/runner/src/types/runner.ts @@ -19,6 +19,7 @@ export interface VitestRunnerConfig { maxConcurrency: number testTimeout: number hookTimeout: number + retry: number } export type VitestRunnerImportSource = 'collect' | 'setup' diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts index 8a3b6b7557e5..6da51cf0a20d 100644 --- a/packages/vitest/src/node/cli.ts +++ b/packages/vitest/src/node/cli.ts @@ -47,6 +47,7 @@ cli .option('--inspect', 'Enable Node.js inspector') .option('--inspect-brk', 'Enable Node.js inspector with break') .option('--test-timeout