summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2021-07-30 01:15:11 +0530
committerGitHub <noreply@github.com>2021-07-29 21:45:11 +0200
commit2b13bb694532904704c16bec4e8a47c386e681e2 (patch)
tree0021131ce86873a5aa965d79b99185b3ca5c5aff /cli/tests
parenteece46f0d85faa90c97841a4f409be39272e809b (diff)
feat(runtime): implement navigator.hardwareConcurrency (#11448)
This commit implements "navigator.hardwareConcurrency" API, which supersedes "Deno.systemCpuInfo()" API (which was removed in this commit).
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/navigator_test.ts6
-rw-r--r--cli/tests/unit/os_test.ts6
2 files changed, 6 insertions, 6 deletions
diff --git a/cli/tests/unit/navigator_test.ts b/cli/tests/unit/navigator_test.ts
new file mode 100644
index 000000000..10475d973
--- /dev/null
+++ b/cli/tests/unit/navigator_test.ts
@@ -0,0 +1,6 @@
+// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+import { assert, unitTest } from "./test_util.ts";
+
+unitTest(function navigatorNumCpus(): void {
+ assert(navigator.hardwareConcurrency > 0);
+});
diff --git a/cli/tests/unit/os_test.ts b/cli/tests/unit/os_test.ts
index 9b0f71352..daa7a1ca2 100644
--- a/cli/tests/unit/os_test.ts
+++ b/cli/tests/unit/os_test.ts
@@ -203,9 +203,3 @@ unitTest({ perms: { env: true } }, function systemMemoryInfo(): void {
assert(info.swapTotal >= 0);
assert(info.swapFree >= 0);
});
-
-unitTest({ perms: { env: true } }, function systemCpuInfo(): void {
- const { cores, speed } = Deno.systemCpuInfo();
- assert(cores === undefined || cores > 0);
- assert(speed === undefined || speed > 0);
-});