Skip to content

Commit 6962acb

Browse files
committed
test(MongoInstance): add test for mongodb lts 5.0.3
1 parent f529ff3 commit 6962acb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/mongodb-memory-server-core/src/__tests__/testUtils/globalSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { assertion, isNullOrUndefined } from '../../util/utils';
55
export = async function globalSetup(): Promise<void> {
66
const defaultVersion = resolveConfig(ResolveConfigVariables.VERSION);
77
assertion(!isNullOrUndefined(defaultVersion), new Error('Default version is not defined'));
8-
const versions = [defaultVersion, '4.0.25', '4.2.14', '4.4.6'];
8+
const versions = [defaultVersion, '4.0.25', '4.2.14', '4.4.6', '5.0.3'];
99
// Ensure all required versions are downloaded for tests
1010
for (const version of versions) {
1111
await MongoBinary.getPath({ version });

packages/mongodb-memory-server-core/src/util/__tests__/MongoInstance.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,16 @@ describe('MongodbInstance', () => {
233233
expect(mongod.mongodProcess!.pid).toBeGreaterThan(0);
234234
await mongod.stop();
235235
});
236+
237+
it('should work with mongodb 5.0', async () => {
238+
const gotPort = await getPort({ port: 27445 });
239+
const mongod = await MongodbInstance.create({
240+
instance: { port: gotPort, dbPath: tmpDir.name },
241+
binary: { version: '5.0.3' },
242+
});
243+
expect(mongod.mongodProcess!.pid).toBeGreaterThan(0);
244+
await mongod.stop();
245+
});
236246
});
237247

238248
it('"kill" should not call "killProcess" if no childProcesses are not running', async () => {

0 commit comments

Comments
 (0)