Closed azohra closed 10 months ago
As a newbie to Deno, I am unclear if a fresh isolate is created for each test. If so, only part of this change is needed in which:
Deno.env.delete
makes sense. The key item I wanted to address was the assumption of GITHUB_CLIENT_ID, and GITHUB_CLIENT_SECRET being set as a result of polluting the env in the deno task test
command. Anything past that, I am a bit out of my depth as it pertains to Deno test runner quirks.
Issue
The e2e test runner was setting ENV from multiple sources leading to cognitive complexity when reading, writing, and running tests. In particular, Github vars were passed as part of
deno task test
while STRIPE entities were not.Observations
test
task.Improvement
I created a
setupEnv
function which defines the base ENV state our application expects and provides a mechanism for mutating it into what a given test requires.DENO_KV_PATH
)Example Behaviours
Pass a computed value as the input for an Environment Variable
Ensure an Environment Variable is unset