From fd6743c4f2062bb4fe8e85c030a2e921dc23d324 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Mon, 18 Jan 2021 23:01:38 +0800 Subject: [PATCH] test(node): ensure process.env case doesn't rely on unset variables (denoland/deno#9144) --- node/process_test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/node/process_test.ts b/node/process_test.ts index 2a789a5d771f..9b2c050a7434 100644 --- a/node/process_test.ts +++ b/node/process_test.ts @@ -131,8 +131,14 @@ Deno.test({ Deno.test({ name: "process.env", fn() { - assertEquals(typeof process.env.PATH, "string"); - assertEquals(typeof env.PATH, "string"); + Deno.env.set("HELLO", "WORLD"); + + assertEquals(typeof (process.env.HELLO), "string"); + assertEquals(process.env.HELLO, "WORLD"); + + // TODO(caspervonb) test the globals in a different setting (they're broken) + // assertEquals(typeof env.HELLO, "string"); + // assertEquals(env.HELLO, "WORLD"); }, });