summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit/metrics_test.ts13
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(),
+ );
+});