Skip to content

Commit 1ff0e90

Browse files
committed
test(MongoBinaryDownloadUrl): add test for "getLinuxOSVersionString" and "unknown"
1 parent 5651db2 commit 1ff0e90

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
@@ -597,5 +597,25 @@ describe('MongoBinaryDownloadUrl', () => {
597597
expect(du.getLegacyVersionString).toHaveBeenCalledTimes(1);
598598
expect(ret).toBe('');
599599
});
600+
601+
it('should give an warning about "unknown"', () => {
602+
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
603+
const du = new MongoBinaryDownloadUrl({
604+
platform: 'linux',
605+
arch: 'x64',
606+
version: '3.6.3',
607+
os: {
608+
os: 'linux',
609+
dist: 'unknown',
610+
release: '0',
611+
codename: 'unknown',
612+
},
613+
});
614+
jest.spyOn(du, 'getLegacyVersionString');
615+
const ret = du.getLinuxOSVersionString(du.os as LinuxOS);
616+
expect(console.warn).toHaveBeenCalledTimes(2);
617+
expect(du.getLegacyVersionString).toHaveBeenCalledTimes(1);
618+
expect(ret).toBe('');
619+
});
600620
});
601621
});

0 commit comments

Comments
 (0)