summaryrefslogtreecommitdiff
path: root/js/platform_test.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-02 12:25:49 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-03 16:59:00 -0400
commitd39055d79bc376924fc2ffe138c26ba6b50aa33f (patch)
tree1abc6e8932dd5227c0d34c7fe9b875284317ce9f /js/platform_test.ts
parent0cdf1f451d0b3c67f2d7c0c2817f712eb6c87987 (diff)
Clean up deno.platform
Renames: deno.platform -> deno.platform.os deno.arch -> deno.platform.arch Removes unsupported operating systems and CPU architectures from the types. Uses the string "win" instead of "win32".
Diffstat (limited to 'js/platform_test.ts')
-rw-r--r--js/platform_test.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/platform_test.ts b/js/platform_test.ts
index 80a1d9325..65cd2572d 100644
--- a/js/platform_test.ts
+++ b/js/platform_test.ts
@@ -2,8 +2,10 @@
import { test, assert } from "./test_util.ts";
import * as deno from "deno";
-test(function transformPlatformSuccess() {
- // Make sure they are transformed
- assert(deno.arch !== "unknown");
- assert(deno.platform !== "unknown");
+test(function platformTransform() {
+ // deno.platform is injected by rollup at compile time. Here
+ // we check it has been properly transformed.
+ const { arch, os } = deno.platform;
+ assert(arch === "x64");
+ assert(os === "mac" || os === "win" || os === "linux");
});