Closed doomsower closed 4 years ago
I'm generating my fixtures programmatically and I'd like to use environment variables in fixtures like this: id: '<{process.env.ADMIN_USER_ID}>'. Currently I have to manually modify parameters like this:
id: '<{process.env.ADMIN_USER_ID}>'
loader.load(path.resolve(__dirname, process.env.NODE_ENV)); const configs = loader.fixtureConfigs; configs.forEach((cfg) => { if (cfg.entity === 'User') { set(cfg, 'cfg.parameters.userIds.admin', process.env.ADMIN_USER_ID); } });
It would be nice to have process.env added to parameters by default. I've looked at the sources and could not decide where it fits.
process.env
I'm also interested in that feature or another way to include global parameters for all fixtures - e.g userId that is used in another microservice
userId
I'm generating my fixtures programmatically and I'd like to use environment variables in fixtures like this:
id: '<{process.env.ADMIN_USER_ID}>'
. Currently I have to manually modify parameters like this:It would be nice to have
process.env
added to parameters by default. I've looked at the sources and could not decide where it fits.