File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -103,19 +103,20 @@ export function rigTestNode(
103103 handler : ( args : { rig : WireitTestRig } ) => unknown ,
104104 options ?: { flaky ?: boolean } ,
105105) : TestFn {
106+ const runTest = async ( ) => {
107+ await using rig = await WireitTestRig . setup ( ) ;
108+ await handler ( { rig} ) ;
109+ } ;
106110 if ( options ?. flaky ) {
107111 return async ( ) => {
108112 try {
109- await handler ( { rig : await WireitTestRig . setup ( ) } ) ;
110- return ;
113+ return await runTest ( ) ;
111114 } catch {
112115 console . log ( 'Test failed, retrying...' ) ;
113116 }
114- await handler ( { rig : await WireitTestRig . setup ( ) } ) ;
117+ return await runTest ( ) ;
115118 } ;
116119 } else {
117- return async ( ) => {
118- await handler ( { rig : await WireitTestRig . setup ( ) } ) ;
119- } ;
120+ return runTest ;
120121 }
121122}
You can’t perform that action at this time.
0 commit comments