From c08319262afeca47d1b9f3dbfa3254e692a48a2d Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 28 Dec 2023 09:08:50 +0530 Subject: fix(node): Implement os.cpus() (#21697) Fixes https://github.com/denoland/deno/issues/21666 Zero added dependency and tries to match the libuv implementation --- cli/tests/unit_node/os_test.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'cli/tests/unit_node') 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); } }, }); -- cgit v1.2.3