File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ namespace Moduless
261
261
for await ( const checkerFn of coverResult )
262
262
await execCheckerAsync ( coverFunctionName , checkerFn ) ;
263
263
264
- maybeRunEnvironmentReset ( coverNamespace ) ;
264
+ await maybeRunEnvironmentReset ( coverNamespace ) ;
265
265
}
266
266
267
267
/** */
@@ -340,12 +340,15 @@ namespace Moduless
340
340
* and runs this function if it exists. The environment reset function needs to
341
341
* be named "modulessReset"
342
342
*/
343
- function maybeRunEnvironmentReset ( ns : Namespace )
343
+ async function maybeRunEnvironmentReset ( ns : Namespace )
344
344
{
345
345
const resetFn = ns [ "modulessReset" ] as Function ;
346
346
if ( typeof resetFn !== "function" )
347
347
return ;
348
348
349
- resetFn ( ) ;
349
+ const result = resetFn ( ) ;
350
+ if ( result instanceof Promise )
351
+ await result ;
352
+
350
353
}
351
354
}
You can’t perform that action at this time.
0 commit comments