From 6a50615e7cc703b28a3e60c15980568c2fb0a020 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Mon, 18 Jan 2021 23:01:38 +0800 Subject: [PATCH] test(std/node): ensure process.env case doesn't rely on unset variables (#9144) --- std/node/process_test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/std/node/process_test.ts b/std/node/process_test.ts index 2a789a5d77..9b2c050a74 100644 --- a/std/node/process_test.ts +++ b/std/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"); }, });