jest-mongodb icon indicating copy to clipboard operation
jest-mongodb copied to clipboard

[Question] about process.env

Open ericcheunghk01 opened this issue 6 years ago • 3 comments

Dear vladgolubev,

I'm new into Jest

I would like to ask any reason behind to use a persistent json file to get mongo db_name mongo_url, etc.

As I saw this line of code. Why don't we just return process.env.something instead of save into a new json file?

ericcheunghk01 avatar Oct 19 '18 12:10 ericcheunghk01

I'm using process.env in my project:

https://github.com/RodolfoSilva/graphql-typescript-server-boilerplate

You can check here:

https://github.com/RodolfoSilva/graphql-typescript-server-boilerplate/blob/master/scripts/jest-globalSetup.js

RodolfoSilva avatar Oct 22 '18 13:10 RodolfoSilva

Is there a way to customize the name of the variable? in my case I use MONGODB_URL because that's the name Now.sh set on deploy, and Heroku use MONGODB_URI

leosuncin avatar Mar 15 '20 19:03 leosuncin

@leosuncin you can make little pr to set variable name from the configuration ;)

randomhash avatar Jul 27 '20 08:07 randomhash