Skip to content

Commit 68d7a32

Browse files
committed
test(MongoInstance): add test for mongodb binary 8.0.0
fixes #891
1 parent e1e3f74 commit 68d7a32

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ 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.24', '4.4.28', '5.0.19', '6.0.14', '7.0.11'];
8+
const versions = [
9+
defaultVersion,
10+
'4.0.28',
11+
'4.2.24',
12+
'4.4.28',
13+
'5.0.19',
14+
'6.0.14',
15+
'7.0.11',
16+
'8.0.1',
17+
];
918
// Ensure all required versions are downloaded for tests
1019
for (const version of versions) {
1120
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
@@ -269,6 +269,17 @@ describe('MongodbInstance', () => {
269269
expect(mongod.mongodProcess!.pid).toBeGreaterThan(0);
270270
await mongod.stop();
271271
});
272+
273+
it('should work with mongodb 8.0', async () => {
274+
const gotPort = await getFreePort(27445);
275+
const mongod = await MongodbInstance.create({
276+
// this works without problems, because no explicit storage-engine is given, so mongodb automatically chooses wiredTiger
277+
instance: { port: gotPort, dbPath: tmpDir },
278+
binary: { version: '8.0.1' },
279+
});
280+
expect(mongod.mongodProcess!.pid).toBeGreaterThan(0);
281+
await mongod.stop();
282+
});
272283
});
273284

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

0 commit comments

Comments
 (0)