Not super confident in JS/Node, so need some clarification regarding environment variables.
My app is running on Sashido, where I can configure Environment Variables in their dashboard. For running my server locally while developing, I’ve been using an .env
file. Now, I’ve added testing with Jest and to add ENV in the tests I import a setEnvVars.js
file in the jest.config.js
file.
Can you recommend a way to provide the env vars for running locally and testing (JEST) in a single solution? I now rely on both the .env
file and setEnvVars.js
, which basically contain duplicate info.
My jest.config.js
module.exports = {
setupFiles: ["./setEnvVars.js"]
};