Skip to content

Commit 51cca3e

Browse files
committed
test(MongoBinaryDownloadUrl): add more tests for arch binary selection
re #762
1 parent 409d5fb commit 51cca3e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,46 @@ describe('MongoBinaryDownloadUrl', () => {
659659
expect(console.warn).toHaveBeenCalledTimes(1);
660660
});
661661

662+
it('for arch for 5.0.0', async () => {
663+
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
664+
665+
const du = new MongoBinaryDownloadUrl({
666+
platform: 'linux',
667+
arch: 'x64',
668+
version: '5.0.0',
669+
os: {
670+
os: 'linux',
671+
dist: 'Arch',
672+
release: 'rolling',
673+
id_like: ['arch'],
674+
},
675+
});
676+
expect(await du.getDownloadUrl()).toBe(
677+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.0.tgz'
678+
);
679+
expect(console.warn).toHaveBeenCalledTimes(1);
680+
});
681+
682+
it('for arch for 6.0.4', async () => {
683+
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
684+
685+
const du = new MongoBinaryDownloadUrl({
686+
platform: 'linux',
687+
arch: 'x64',
688+
version: '6.0.4',
689+
os: {
690+
os: 'linux',
691+
dist: 'Arch',
692+
release: 'rolling',
693+
id_like: ['arch'],
694+
},
695+
});
696+
expect(await du.getDownloadUrl()).toBe(
697+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz'
698+
);
699+
expect(console.warn).toHaveBeenCalledTimes(1);
700+
});
701+
662702
it('for manjaro for 4.4.2', async () => {
663703
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
664704

0 commit comments

Comments
 (0)