Skip to content

Commit bf8ff9e

Browse files
maxfriedmannnodkz
authored andcommitted
fix: download url exception for win32 & v4.2.0
1 parent 428b9f3 commit bf8ff9e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ export default class MongoBinaryDownloadUrl {
4949
async getArchiveNameWin(): Promise<string> {
5050
let name = `mongodb-${this.platform}`;
5151
name += `-${this.arch}`;
52-
name += '-2008plus-ssl';
52+
if (this.version.indexOf('4.2') === 0) {
53+
name += '-2012plus';
54+
}
55+
else {
56+
name += '-2008plus-ssl';
57+
}
5358
name += `-${this.version}.zip`;
5459
return name;
5560
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ describe('MongoBinaryDownloadUrl', () => {
8080
);
8181
});
8282

83+
it('4.2 for win32', async () => {
84+
const du = new MongoBinaryDownloadUrl({
85+
platform: 'win32',
86+
arch: 'x64',
87+
version: '4.2.0',
88+
});
89+
expect(await du.getDownloadUrl()).toBe(
90+
'https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2012plus-4.2.0.zip'
91+
);
92+
});
93+
8394
it('fallback', async () => {
8495
const du = new MongoBinaryDownloadUrl({
8596
platform: 'linux',

0 commit comments

Comments
 (0)