You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deno run without --allow-env permission prompts as expected:
SOME_ENV_VAR=1 deno run test.ts
# ┏ ⚠️ Deno requests env access to "SOME_ENV_VAR".# ┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.# ┠─ Learn more at: https://docs.deno.com/go/--allow-env# ┠─ Run again with --allow-env to bypass this prompt.# ┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions) >
However, deno test without --allow-env silently returns undefined (expected to throw error, as deno test doesn't prompt for permissions):
SOME_ENV_VAR=1 deno test test.ts
# Check file:///path/to/test.ts# ------- pre-test output -------# undefined# ----- pre-test output end -----# running 0 tests from ./test.ts## ok | 0 passed | 0 failed (2ms)
Conversely, deno testing the equivalent code with Deno.env.get('SOME_ENV_VAR') throws as expected.