File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ describeMemoryTests("Memory Tests", () => {
2727
2828 function runMemoryTest (
2929 testName : string ,
30- testFn : ( ) => void ,
30+ testFn : ( ) => void | Promise < void > ,
3131 options : {
3232 iterations ?: number ;
3333 warmupIterations ?: number ;
@@ -42,20 +42,20 @@ describeMemoryTests("Memory Tests", () => {
4242 errorMargin = 0.1 ,
4343 } = options ;
4444
45- test ( testName , ( ) => {
45+ test ( testName , async ( ) => {
4646 const measurements : number [ ] = [ ] ;
4747
4848 // Warm up
4949 for ( let i = 0 ; i < warmupIterations ; i ++ ) {
50- testFn ( ) ;
50+ await testFn ( ) ;
5151 if ( gc ) gc ( ) ;
5252 }
5353
5454 // Take measurements
5555 for ( let i = 0 ; i < iterations ; i ++ ) {
5656 // run gc() before each measurement:
5757 getMemoryUsage ( ) ;
58- testFn ( ) ;
58+ await testFn ( ) ;
5959 const after = getMemoryUsage ( ) ;
6060 measurements . push ( after ) ;
6161
You can’t perform that action at this time.
0 commit comments