I have an app that depends on environmental variables like:
const APP_PORT = process.env.APP_PORT || 8080;
and I would like to test that fo
In ./package.json:
./package.json
"jest": { "setupFiles": [ "/jest/setEnvVars.js" ] }
In ./jest/setEnvVars.js:
./jest/setEnvVars.js
process.env.SOME_VAR = 'value';