Repository navigation
Pin MongoDB test binary version in Jest setup - #312
Merged
Tybravo merged 1 commit intoOct 22, 2026
Merged
Conversation
mongodb-memory-server fell back to its default 6.0.x binary because only the root jest.setup.js set MONGOMS_VERSION, and Jest does not load that file. Set the version in tests/jest.setup.ts instead. An existing MONGOMS_VERSION in the environment still takes precedence.
|
Hey @BigNathan1! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mongodb-memory-serverpicks its binary version fromMONGOMS_VERSION. The repository sets that in the rootjest.setup.js, but Jest loadstests/jest.setup.ts(perjest.config.js), so the pin never applied. Tests then downloaded the default MongoDB 6.0.x binary, which is large and can stall or fail on slow connections.This PR moves the pin into
tests/jest.setup.ts. An existingMONGOMS_VERSIONin the environment still takes precedence, so CI can override it.Verification
Run on this branch with
MONGOMS_VERSIONunset in the shell:Result: 1 suite passed, 24 of 24 tests passed. No MongoDB 6.0.14 download was triggered, and the suite used the cached 7.0.14 binary. Before this change the same suite failed with
Test suite failed to runbecause the 6.0.14 download was interrupted.Scope
One file changed:
tests/jest.setup.ts, plus the comment explaining the pin. No test or source code changes.Follow-up
The root
jest.setup.jsstill sets the same variable, and it is not loaded by Jest. It is harmless but misleading. It can be removed in a separate change.