Skip to content

Commit de19de7

Browse files
committed
test(MongoBinaryDownloadUrl): add test for "fallback unknown"
1 parent 39b0a3d commit de19de7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,26 @@ describe('MongoBinaryDownloadUrl', () => {
302302
expect(console.warn).toHaveBeenCalledTimes(1);
303303
});
304304

305+
it('fallback unknown', async () => {
306+
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
307+
308+
const du = new MongoBinaryDownloadUrl({
309+
platform: 'linux',
310+
arch: 'x64',
311+
version: '3.6.3',
312+
os: {
313+
os: 'linux',
314+
dist: 'unknown', // "unknown" to test the case of failing to parse a name
315+
release: '',
316+
},
317+
});
318+
319+
expect(await du.getDownloadUrl()).toBe(
320+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.3.tgz'
321+
);
322+
expect(console.warn).toHaveBeenCalledTimes(2);
323+
});
324+
305325
it('for manjaro', async () => {
306326
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
307327

0 commit comments

Comments
 (0)