Skip to content

Commit 2aa9b38

Browse files
committed
fix(MongoBinaryDownloadUrl): support macos arm64 to x64 archive translation
1 parent b5f4c23 commit 2aa9b38

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ export class MongoBinaryDownloadUrl {
112112
name = `mongodb-macos`; // somehow these files are not listed in https://www.mongodb.org/dl/osx
113113
}
114114

115+
if (this.arch === 'arm64') {
116+
log('getArchiveNameOsx: Arch is "arm64", using x64 binary');
117+
this.arch = 'x86_64';
118+
}
119+
115120
name += `-${this.arch}`;
116121
name += `-${this.version}.tgz`;
117122

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
@@ -52,6 +52,17 @@ describe('MongoBinaryDownloadUrl', () => {
5252
'https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.0.0.tgz'
5353
);
5454
});
55+
56+
it('arm64 should use the x64 binary', async () => {
57+
const du = new MongoBinaryDownloadUrl({
58+
platform: 'darwin',
59+
arch: 'arm64',
60+
version: '4.4.0',
61+
});
62+
expect(await du.getDownloadUrl()).toBe(
63+
'https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.4.0.tgz'
64+
);
65+
});
5566
});
5667

5768
describe('for linux', () => {

0 commit comments

Comments
 (0)