You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add and option to disable jest-mongodb and use real database, so it's possible to use the same tests both in local and/or unit tests, and for a real deployment like integration tests.
Implementation would be easy, just a matter creating the MongodbMemoryServer instance inside
if global.__MONGOD__ has been set... Problem is what condition to use. Obvious one would be an environment variable, like if process.env.MONGO_URL is already set, but maybe overwritting it by jest-mongodb could be a valid use case, for example if it's already set in a .env file... Maybe a DISABLE_JEST_MONGODB environment variable?
The text was updated successfully, but these errors were encountered:
Add and option to disable
jest-mongodb
and use real database, so it's possible to use the same tests both in local and/or unit tests, and for a real deployment like integration tests.Implementation would be easy, just a matter creating the
MongodbMemoryServer
instance insidejest-mongodb/setup.js
Line 11 in ea02ede
jest-mongodb/teardown.js
Line 3 in ea02ede
global.__MONGOD__
has been set... Problem is what condition to use. Obvious one would be an environment variable, like ifprocess.env.MONGO_URL
is already set, but maybe overwritting it byjest-mongodb
could be a valid use case, for example if it's already set in a.env
file... Maybe aDISABLE_JEST_MONGODB
environment variable?The text was updated successfully, but these errors were encountered: