diff options
author | Marvin Hagemeister <marvin@deno.com> | 2024-07-10 19:47:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-10 19:47:45 +0200 |
commit | 26288cf2a97334e6d8e6697d0b858ad8582802b9 (patch) | |
tree | fd8ae58bf7eff1ce47db45f7e8804bebc3a3c681 /tests/unit_node/perf_hooks_test.ts | |
parent | 60668c1e9370229f253b52a67cba983ce4cdac63 (diff) |
fix(node/perf_hooks): stub eventLoopUtilization (#24501)
This PR stubs `perf_hooks.eventLoopUtilization` to make the tests of
[hapi](https://github.com/hapijs/hapi) start. Previously, they'd all
error because of this function throwing a not implemented error. This
brings down the test failures in their suite from 982 to 68 failures.
Diffstat (limited to 'tests/unit_node/perf_hooks_test.ts')
-rw-r--r-- | tests/unit_node/perf_hooks_test.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit_node/perf_hooks_test.ts b/tests/unit_node/perf_hooks_test.ts index 86c4aee4c..1b066a42b 100644 --- a/tests/unit_node/perf_hooks_test.ts +++ b/tests/unit_node/perf_hooks_test.ts @@ -61,3 +61,10 @@ Deno.test({ }); }, }); + +Deno.test("[perf_hooks]: eventLoopUtilization", () => { + const obj = performance.eventLoopUtilization(); + assertEquals(typeof obj.idle, "number"); + assertEquals(typeof obj.active, "number"); + assertEquals(typeof obj.utilization, "number"); +}); |