From 7d9ba09f5a4464072476b8992e43f5e5c30bde3a Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 13 Nov 2024 19:47:01 +0530 Subject: fix(ext/node): use ERR_NOT_IMPLEMENTED for notImplemented (#26853) --- tests/unit_node/perf_hooks_test.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit_node/perf_hooks_test.ts b/tests/unit_node/perf_hooks_test.ts index d5b900041..8247f9fd3 100644 --- a/tests/unit_node/perf_hooks_test.ts +++ b/tests/unit_node/perf_hooks_test.ts @@ -1,6 +1,10 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import * as perfHooks from "node:perf_hooks"; -import { performance, PerformanceObserver } from "node:perf_hooks"; +import { + monitorEventLoopDelay, + performance, + PerformanceObserver, +} from "node:perf_hooks"; import { assertEquals, assertThrows } from "@std/assert"; Deno.test({ @@ -68,3 +72,12 @@ Deno.test("[perf_hooks]: eventLoopUtilization", () => { assertEquals(typeof obj.active, "number"); assertEquals(typeof obj.utilization, "number"); }); + +Deno.test("[perf_hooks]: monitorEventLoopDelay", () => { + const e = assertThrows(() => { + monitorEventLoopDelay({ resolution: 1 }); + }); + + // deno-lint-ignore no-explicit-any + assertEquals((e as any).code, "ERR_NOT_IMPLEMENTED"); +}); -- cgit v1.2.3