Skip to content

Commit 916f714

Browse files
committed
test: add basic test for mongodb 7.0.0
1 parent b9a1c1c commit 916f714

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-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.28', '4.2.23', '4.4.22', '5.0.19', '6.0.9'];
8+
const versions = [defaultVersion, '4.0.28', '4.2.23', '4.4.22', '5.0.19', '6.0.9', '7.0.0'];
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,17 @@ describe('MongodbInstance', () => {
257257
expect(mongod.mongodProcess!.pid).toBeGreaterThan(0);
258258
await mongod.stop();
259259
});
260+
261+
it('should work with mongodb 7.0', async () => {
262+
const gotPort = await getFreePort(27445);
263+
const mongod = await MongodbInstance.create({
264+
// this works without problems, because no explicit storage-engine is given, so mongodb automatically chooses wiredTiger
265+
instance: { port: gotPort, dbPath: tmpDir },
266+
binary: { version: '7.0.0' },
267+
});
268+
expect(mongod.mongodProcess!.pid).toBeGreaterThan(0);
269+
await mongod.stop();
270+
});
260271
});
261272

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

0 commit comments

Comments
 (0)