diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-08-25 09:43:54 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 19:43:54 -0400 |
commit | c4d5b01acfe0cac31f94743a57e8e619178ba563 (patch) | |
tree | 1987fe2e23c4db59a44159f4c7d21ecc61be4ad3 /std/testing/bench.ts | |
parent | 9b0f9c876529696c8008dda8b3606e34d3fe98dc (diff) |
feat: update to TypeScript 4.0 (#6514)
Diffstat (limited to 'std/testing/bench.ts')
-rw-r--r-- | std/testing/bench.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/std/testing/bench.ts b/std/testing/bench.ts index b8bf40a9b..e1d3c86c9 100644 --- a/std/testing/bench.ts +++ b/std/testing/bench.ts @@ -1,4 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +import { assert } from "../_util/assert.ts"; import { deepAssign } from "../_util/deep_assign.ts"; interface BenchmarkClock { @@ -70,11 +71,11 @@ export interface BenchmarkRunResult { /** Defines the current progress during the run of `runBenchmarks` */ export interface BenchmarkRunProgress extends BenchmarkRunResult { /** List of the queued benchmarks to run with their name and their run count */ - queued: Array<{ name: string; runsCount: number }>; + queued?: Array<{ name: string; runsCount: number }>; /** The currently running benchmark with its name, run count and the already finished measurements in milliseconds */ running?: { name: string; runsCount: number; measuredRunsMs: number[] }; /** Indicates in which state benchmarking currently is */ - state: ProgressState; + state?: ProgressState; } /** Defines the states `BenchmarkRunProgress` can be in */ @@ -232,6 +233,7 @@ export async function runBenchmarks( clock.for = name; // Remove benchmark from queued + assert(progress.queued); const queueIndex = progress.queued.findIndex( (queued) => queued.name === name && queued.runsCount === runs, ); |