colin
08/19/2021, 2:40 PMsst test
command? It doesn’t seem that having a .env.test
file injects the test environment vars into the test environment but I don’t want to overwrite the jest.config under the hood.Frank
.env.test
only injects env vars into the SST code.Frank
colin
08/19/2021, 2:44 PMprocess.env = {}
Frank
beforeAll(() => {
process.env = Object.assign(process.env, { MY_ENV: '...' });
});
I guess this is the best way:
beforeAll(() => {
process.env = {};
});
Ross Coundon
08/19/2021, 5:02 PMcolin
08/20/2021, 5:34 PMprocess.env
with real values which makes me thing something like @Ross Coundon mentioned is occurring higher up.
beforeAll(() => {
process.env = Object.assign(process.env, {})
console.log('process.env: ', process.env) // has stuff
})
I have two env files in my root one .env
and one .env.test
. I could have sworn tests used to get populated with the .env.test
values…
Im running the tests with this command: npm run test -- --watch
which becomes sst test "--watch"