Skip to content

Commit 0e90784

Browse files
committed
fix(MongoBinaryDownloadUrl::getUbuntuVersionString): change "os" for elementary to be optional
re #735
1 parent 3110cb4 commit 0e90784

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
436436
};
437437
}
438438

439-
if (/^elementary\s?os\s*$/i.test(os.dist)) {
439+
if (/^elementary(?:\s?os)?\s*$/i.test(os.dist)) {
440440
const elementaryToUbuntuRelease: Record<number, string> = {
441441
3: '14.04',
442442
4: '16.04',

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
@@ -813,6 +813,26 @@ describe('MongoBinaryDownloadUrl', () => {
813813
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.4.1.tgz'
814814
);
815815
});
816+
817+
it('should return a archive name for elementary 6.1', async () => {
818+
const du = new MongoBinaryDownloadUrl({
819+
platform: 'linux',
820+
arch: 'x64',
821+
version: '5.0.0',
822+
// from "elementary/docker:fe08f970723a"
823+
os: {
824+
os: 'linux',
825+
dist: 'elementary',
826+
codename: 'jolnir',
827+
release: '6.1',
828+
id_like: ['ubuntu'],
829+
},
830+
});
831+
832+
expect(await du.getDownloadUrl()).toBe(
833+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.0.tgz'
834+
);
835+
});
816836
});
817837

818838
describe('for LinuxMint', () => {

0 commit comments

Comments
 (0)