Skip to content

Conversation

@JamieSinn
Copy link

For the same usecase as specified in my other PR: #389

In our monorepo there's currently a problem where executing tests from the root directory via Nx means that the preset does not look in the correct (project directory) location for the jest-mongodb-config.js file.

This updates the helpers that determine that file's location to get the cwd from Jest's globalConfig rather than reading it from process.cwd(). Since it needs to Jest config to do this, I moved the instantiation of the MongoMemoryServer class to be inside the environment class's constructor.

I also added a devDependency on jest-environment-node because Typescript was complaining about not having type definitions for it (since its listed as a peerDependency)

cc @ajwootto

@harazdovskiy
Copy link
Contributor

Sorry for the long response, we have added your proposed changes to our 4.3.0 release!
https://github.com/shelfio/jest-mongodb/releases/tag/v4.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants