Skip to content

Commit

Permalink
fix(env): refactor set-env-var, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlindquist committed Dec 6, 2024
1 parent 3fa3dc6 commit 3032f9e
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/cli/set-env-var.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3032f9e

Please sign in to comment.