diff options
Diffstat (limited to 'std/testing/bench_test.ts')
-rw-r--r-- | std/testing/bench_test.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/std/testing/bench_test.ts b/std/testing/bench_test.ts index a56d4fd55..0b101c22f 100644 --- a/std/testing/bench_test.ts +++ b/std/testing/bench_test.ts @@ -338,6 +338,27 @@ test({ }, }); +test({ + name: "async progressCallback", + fn: async function (): Promise<void> { + clearBenchmarks(); + dummyBench("single"); + + const asyncCallbacks = []; + + await runBenchmarks({ silent: true }, (progress) => { + return new Promise((resolve) => { + queueMicrotask(() => { + asyncCallbacks.push(progress); + resolve(); + }); + }); + }); + + assertEquals(asyncCallbacks.length, 5); + }, +}); + function dummyBench(name: string, runs = 1): void { bench({ name, |