diff options
Diffstat (limited to 'js/metrics_test.ts')
-rw-r--r-- | js/metrics_test.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/js/metrics_test.ts b/js/metrics_test.ts index 77473a1d5..cb76eb854 100644 --- a/js/metrics_test.ts +++ b/js/metrics_test.ts @@ -1,9 +1,8 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import { test, testPerm, assert } from "./test_util.ts"; -import * as deno from "deno"; test(async function metrics() { - const m1 = deno.metrics(); + const m1 = Deno.metrics(); assert(m1.opsDispatched > 0); assert(m1.opsCompleted > 0); assert(m1.bytesSentControl > 0); @@ -13,9 +12,9 @@ test(async function metrics() { // Write to stdout to ensure a "data" message gets sent instead of just // control messages. const dataMsg = new Uint8Array([41, 42, 43]); - await deno.stdout.write(dataMsg); + await Deno.stdout.write(dataMsg); - const m2 = deno.metrics(); + const m2 = Deno.metrics(); assert(m2.opsDispatched > m1.opsDispatched); assert(m2.opsCompleted > m1.opsCompleted); assert(m2.bytesSentControl > m1.bytesSentControl); @@ -24,21 +23,21 @@ test(async function metrics() { }); testPerm({ write: true }, function metricsUpdatedIfNoResponseSync() { - const filename = deno.makeTempDirSync() + "/test.txt"; + const filename = Deno.makeTempDirSync() + "/test.txt"; const data = new Uint8Array([41, 42, 43]); - deno.writeFileSync(filename, data, { perm: 0o666 }); + Deno.writeFileSync(filename, data, { perm: 0o666 }); - const metrics = deno.metrics(); + const metrics = Deno.metrics(); assert(metrics.opsDispatched === metrics.opsCompleted); }); testPerm({ write: true }, async function metricsUpdatedIfNoResponseAsync() { - const filename = deno.makeTempDirSync() + "/test.txt"; + const filename = Deno.makeTempDirSync() + "/test.txt"; const data = new Uint8Array([41, 42, 43]); - await deno.writeFile(filename, data, { perm: 0o666 }); + await Deno.writeFile(filename, data, { perm: 0o666 }); - const metrics = deno.metrics(); + const metrics = Deno.metrics(); assert(metrics.opsDispatched === metrics.opsCompleted); }); |