From 3032f9ef2bd5606e304b358836c9a1cdd891df18 Mon Sep 17 00:00:00 2001 From: John Lindquist Date: Fri, 6 Dec 2024 13:31:29 -0700 Subject: [PATCH] fix(env): refactor set-env-var, add tests --- src/cli/set-env-var.test.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/cli/set-env-var.test.ts b/src/cli/set-env-var.test.ts index b09c2fa3..c87739dc 100644 --- a/src/cli/set-env-var.test.ts +++ b/src/cli/set-env-var.test.ts @@ -75,17 +75,6 @@ await tmp.withDir(async (dir) => { t.is(parsed.HELLO, "WORLD") }) - ava.serial("await env should set a new environment variable", async (t:Context) => { - args.push("1234") - await env("API_KEY") // Env will pull off the last arg - const contents = await readFile(kitDotEnvPath(), "utf-8") - const {parsed, error} = dotenv.config({ - files: [kitDotEnvPath()], - }) - t.log({ parsed, error, contents }) - t.is(parsed.API_KEY, "1234") - }) - ava.serial("should update an existing environment variable", async (t:Context) => { await writeFile(t.context.envFile, "EXISTING_KEY=old_value\n") await global.setEnvVar("EXISTING_KEY", "new_value")