From d4db895a6dca911671a66cc8b551caf554f25e6c Mon Sep 17 00:00:00 2001 From: BigNathan1 Date: Wed, 21 Oct 2026 21:28:36 -0700 Subject: [PATCH] Pin MongoDB test binary to 7.0.14 in Jest setup 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. --- tests/jest.setup.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/jest.setup.ts b/tests/jest.setup.ts index f677ecc..26e590c 100644 --- a/tests/jest.setup.ts +++ b/tests/jest.setup.ts @@ -1,5 +1,9 @@ process.env.NODE_ENV = 'test'; process.env.MONGOMS_DOWNLOAD_PROGRESS = '0'; +// Pin the MongoDB binary used by mongodb-memory-server. Without this, the +// default (6.0.x) is downloaded on first run. A value set in the environment +// still takes precedence so CI can override it. +process.env.MONGOMS_VERSION = process.env.MONGOMS_VERSION ?? '7.0.14'; // The env schema requires a >=16 char JWT secret and tests sign tokens with // this exact value. dotenv does not override real environment variables, so // this only applies when the runner does not provide a usable secret (a