Skip to content

Commit

Permalink
fix env restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
ABevier authored and mxcl committed Mar 31, 2023
1 parent e754664 commit d683dc7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/functional/args.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { assertEquals } from "deno/testing/asserts.ts"
import { wut } from "../../src/app.main.ts"
import { parseArgs } from "../../src/args.ts"
import { EnvKeys } from "../../src/hooks/useShellEnv.ts"
import { collectEnv, init } from "../../src/init.ts"

Deno.test("parse args", async test => {
Expand Down Expand Up @@ -108,7 +109,9 @@ Deno.test("reads env", () => {
"TEA_FORK_BOMB_PROTECTOR", "TEA_PANTRY_PATH", "TEA_PKGS", "TEA_PREFIX", "TEA_REWIND",
"VERBOSE", "VERSION"]

const oldEnv = keys.map(k => Deno.env.get(k))
const oldEnv = keys.reduce((env, key) => {
return { ...env, [key]: Deno.env.get(key) }
}, {} as Record<string, string | undefined>)

try {
keys.forEach(k => Deno.env.set(k, `${k}-TEST`))
Expand Down

0 comments on commit d683dc7

Please sign in to comment.