Skip to content

Commit 5651db2

Browse files
committed
test(MongoBinaryDownloadUrl): add test for "getLinuxOSVersionString" and "alpine"
1 parent 8f9ac31 commit 5651db2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,4 +576,26 @@ describe('MongoBinaryDownloadUrl', () => {
576576
expect(downloadUrl.getLegacyVersionString()).toBe('');
577577
});
578578
});
579+
580+
describe('getLinuxOSVersionString()', () => {
581+
it('should give an warning about "alpine"', () => {
582+
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
583+
const du = new MongoBinaryDownloadUrl({
584+
platform: 'linux',
585+
arch: 'x64',
586+
version: '3.6.3',
587+
os: {
588+
os: 'linux',
589+
dist: 'alpine',
590+
release: '0',
591+
codename: 'alpine',
592+
},
593+
});
594+
jest.spyOn(du, 'getLegacyVersionString');
595+
const ret = du.getLinuxOSVersionString(du.os as LinuxOS);
596+
expect(console.warn).toHaveBeenCalledTimes(2);
597+
expect(du.getLegacyVersionString).toHaveBeenCalledTimes(1);
598+
expect(ret).toBe('');
599+
});
600+
});
579601
});

0 commit comments

Comments
 (0)