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
I'm working on similar library jest-firestore wich as based on this one.
While working on that library I found few things which might didn't work previously, but they are possible in current jest versions and could be used to greatly simplify "jest-mongodb":
Passing env parameters from Environment. Currently in jest-mongodb when you use shared db for all tests it creates a "process.env.MONGO_URL" but when you separate db for each test it sets global.MONGO_URI. Probably that is because authors struggled with passing ENV variables to the tests from environment. But i tested on jest 29 and this works:
Passing variables from globalSetup to environment. I accidentally discovered that ENV variables created in the globalSetup passed to the environment as well. For "jest-mongodb" it means you can avoid "globalSetup.json" file and pass mongouri to the workers using ENV variables. I don't know in what exact version it was changed, but it works in the jest 29 and tested in jest-firestore package.
Thanks, hope this would be helpful for maintainers.
The text was updated successfully, but these errors were encountered:
Hi there!
I'm working on similar library jest-firestore wich as based on this one.
While working on that library I found few things which might didn't work previously, but they are possible in current jest versions and could be used to greatly simplify "jest-mongodb":
jest-mongodb
when you use shared db for all tests it creates a "process.env.MONGO_URL" but when you separate db for each test it sets global.MONGO_URI. Probably that is because authors struggled with passing ENV variables to the tests from environment. But i tested on jest 29 and this works:Thanks, hope this would be helpful for maintainers.
The text was updated successfully, but these errors were encountered: