diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit_node/perf_hooks_test.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cli/tests/unit_node/perf_hooks_test.ts b/cli/tests/unit_node/perf_hooks_test.ts index 78375d54d..2249e62f8 100644 --- a/cli/tests/unit_node/perf_hooks_test.ts +++ b/cli/tests/unit_node/perf_hooks_test.ts @@ -1,7 +1,10 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import * as perfHooks from "node:perf_hooks"; import { performance } from "node:perf_hooks"; -import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; +import { + assertEquals, + assertThrows, +} from "../../../test_util/std/testing/asserts.ts"; Deno.test({ name: "[perf_hooks] performance", @@ -39,3 +42,14 @@ Deno.test({ assertEquals<unknown>(perfHooks.PerformanceEntry, PerformanceEntry); }, }); + +Deno.test({ + name: "[perf_hooks] performance.timeOrigin", + fn() { + assertEquals(typeof performance.timeOrigin, "number"); + assertThrows(() => { + // @ts-expect-error: Cannot assign to 'timeOrigin' because it is a read-only property + performance.timeOrigin = 1; + }); + }, +}); |