From d39055d79bc376924fc2ffe138c26ba6b50aa33f Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 2 Oct 2018 12:25:49 -0400 Subject: 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". --- js/platform_test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'js/platform_test.ts') 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"); }); -- cgit v1.2.3