diff options
| author | Arash Arbabi <nervous.fiend@gmail.com> | 2019-03-31 00:22:33 +0430 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-03-30 15:52:33 -0400 |
| commit | fd170692ddd48b66bac095db2c9d71fa89bdad43 (patch) | |
| tree | 646d78fd1eff69fa4ca40ca49845a4f7e94f41af /testing/bench_test.ts | |
| parent | d87c37f089d1ba48652f17cba3b73fb0ae0a7eb8 (diff) | |
fix: benchmarks not returning on deno 0.3.4+ (denoland/deno_std#317)
Original: https://github.com/denoland/deno_std/commit/a1ceaa6ef7bd7d79d4f9accb2dbfd53482aa887a
Diffstat (limited to 'testing/bench_test.ts')
| -rw-r--r-- | testing/bench_test.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/testing/bench_test.ts b/testing/bench_test.ts index 345f104a6..8042db480 100644 --- a/testing/bench_test.ts +++ b/testing/bench_test.ts @@ -19,7 +19,8 @@ test(async function benching() { bench(async function forAwaitFetchDenolandX10(b) { b.start(); for (let i = 0; i < 10; i++) { - await fetch("https://deno.land/"); + let r = await fetch("https://deno.land/"); + await r.text(); } b.stop(); }); @@ -27,7 +28,12 @@ test(async function benching() { bench(async function promiseAllFetchDenolandX10(b) { const urls = new Array(10).fill("https://deno.land/"); b.start(); - await Promise.all(urls.map((denoland: string) => fetch(denoland))); + await Promise.all( + urls.map(async (denoland: string) => { + let r = await fetch(denoland); + await r.text(); + }) + ); b.stop(); }); |
