Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to use config file location for finding jest mongodb config #436 #438

Closed
wants to merge 1 commit into from

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
Development

Successfully merging this pull request may close these issues.

2 participants