diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2022-05-24 22:21:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 22:21:32 +0200 |
commit | 5e62ee31d76fcce46d88fea1078552682d082c89 (patch) | |
tree | 010ff5ca8978fcef14574126fc5a9fc99ee92459 /cli | |
parent | d93b7627f0451355027d4fc0f2dd1c63c58ecc3d (diff) |
fix(core): op metrics op_names mismatch (#14716)
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tests/unit/metrics_test.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cli/tests/unit/metrics_test.ts b/cli/tests/unit/metrics_test.ts index dc103f829..82ff7ddd0 100644 --- a/cli/tests/unit/metrics_test.ts +++ b/cli/tests/unit/metrics_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -import { assert } from "./test_util.ts"; +import { assert, assertEquals } from "./test_util.ts"; Deno.test(async function metrics() { // Write to stdout to ensure a "data" message gets sent instead of just @@ -76,3 +76,14 @@ Deno.test(function metricsForOpCrates() { assert(m1.opsDispatched > 0); assert(m1.opsCompleted > 0); }); + +// Test that op_names == Objects.keys(Deno.core.ops) +// since building the per-op metrics depends on op_names being complete +Deno.test(function opNamesMatch() { + assertEquals( + // @ts-ignore: Deno.core allowed + Deno.core.opNames().sort(), + // @ts-ignore: Deno.core allowed + Object.keys(Deno.core.ops).sort(), + ); +}); |