fix(ext/node): use ERR_NOT_IMPLEMENTED for notImplemented (#26853)

This commit is contained in:
Divy Srivastava 2024-11-13 19:47:01 +05:30 committed by GitHub
parent 9331e2cef0
commit 7d9ba09f5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 3 deletions

View file

@ -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");
});