diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-12-28 09:08:50 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 09:08:50 +0530 |
commit | c08319262afeca47d1b9f3dbfa3254e692a48a2d (patch) | |
tree | e4e1bda6fcda59ea696bd559fbcfa89d855c21c3 /cli/tests | |
parent | 48dae2441c2085db345a8d2d225b2c063e740600 (diff) |
fix(node): Implement os.cpus() (#21697)
Fixes https://github.com/denoland/deno/issues/21666
Zero added dependency and tries to match the libuv implementation
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit_node/os_test.ts | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cli/tests/unit_node/os_test.ts b/cli/tests/unit_node/os_test.ts index d687e9d0e..021cf5db1 100644 --- a/cli/tests/unit_node/os_test.ts +++ b/cli/tests/unit_node/os_test.ts @@ -241,13 +241,11 @@ Deno.test({ assertEquals(os.cpus().length, navigator.hardwareConcurrency); for (const cpu of os.cpus()) { - assertEquals(cpu.model, ""); - assertEquals(cpu.speed, 0); - assertEquals(cpu.times.user, 0); - assertEquals(cpu.times.nice, 0); - assertEquals(cpu.times.sys, 0); - assertEquals(cpu.times.idle, 0); - assertEquals(cpu.times.irq, 0); + assert(cpu.model.length > 0); + assert(cpu.speed >= 0); + assert(cpu.times.user > 0); + assert(cpu.times.sys > 0); + assert(cpu.times.idle > 0); } }, }); |