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