@@ -53,15 +53,15 @@ export function createSuiteHooks() {
5353}
5454
5555// implementations
56- function createSuiteCollector ( name : string , factory : SuiteFactory = ( ) => { } , mode : RunMode , concurrent ?: boolean , shuffle ?: boolean , suiteOptions ?: number | TestOptions ) {
56+ function createSuiteCollector ( name : string , factory : SuiteFactory = ( ) => { } , mode : RunMode , concurrent ?: boolean , shuffle ?: boolean , suiteOptions ?: TestOptions ) {
5757 const tasks : ( Test | TaskCustom | Suite | SuiteCollector ) [ ] = [ ]
5858 const factoryQueue : ( Test | Suite | SuiteCollector ) [ ] = [ ]
5959
6060 let suite : Suite
6161
6262 initSuite ( )
6363
64- const test = createTest ( function ( name : string , fn = noop , options = suiteOptions ) {
64+ const test = createTest ( function ( name : string , fn = noop , options ) {
6565 const mode = this . only ? 'only' : this . skip ? 'skip' : this . todo ? 'todo' : 'run'
6666
6767 if ( typeof options === 'number' )
@@ -70,7 +70,8 @@ function createSuiteCollector(name: string, factory: SuiteFactory = () => { }, m
7070 // inherit repeats and retry from suite
7171 if ( typeof suiteOptions === 'object' ) {
7272 options = {
73- ...suiteOptions ,
73+ repeats : suiteOptions . repeats ,
74+ retry : suiteOptions . retry ,
7475 ...options ,
7576 }
7677 }
@@ -122,6 +123,7 @@ function createSuiteCollector(name: string, factory: SuiteFactory = () => { }, m
122123 type : 'collector' ,
123124 name,
124125 mode,
126+ options : suiteOptions ,
125127 test,
126128 tasks,
127129 collect,
@@ -186,6 +188,16 @@ function createSuite() {
186188 function suiteFn ( this : Record < string , boolean | undefined > , name : string , factory ?: SuiteFactory , options ?: number | TestOptions ) {
187189 checkVersion ( )
188190 const mode : RunMode = this . only ? 'only' : this . skip ? 'skip' : this . todo ? 'todo' : 'run'
191+ const currentSuite = getCurrentSuite ( )
192+
193+ if ( typeof options === 'number' )
194+ options = { timeout : options }
195+
196+ if ( currentSuite && typeof currentSuite . options ?. repeats === 'number' ) {
197+ // inherit repeats from current suite
198+ options = { repeats : currentSuite . options . repeats , ...options }
199+ }
200+
189201 return createSuiteCollector ( name , factory , mode , this . concurrent , this . shuffle , options )
190202 }
191203
0 commit comments