Skip to content

Commit

Permalink
test(MongoBinaryDownloadUrl): add more tests for arch binary selection
Browse files Browse the repository at this point in the history
re #762
  • Loading branch information
hasezoey committed Apr 3, 2023
1 parent 409d5fb commit 51cca3e
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,46 @@ describe('MongoBinaryDownloadUrl', () => {
expect(console.warn).toHaveBeenCalledTimes(1);
});

it('for arch for 5.0.0', async () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);

const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '5.0.0',
os: {
os: 'linux',
dist: 'Arch',
release: 'rolling',
id_like: ['arch'],
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.0.tgz'
);
expect(console.warn).toHaveBeenCalledTimes(1);
});

it('for arch for 6.0.4', async () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);

const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '6.0.4',
os: {
os: 'linux',
dist: 'Arch',
release: 'rolling',
id_like: ['arch'],
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz'
);
expect(console.warn).toHaveBeenCalledTimes(1);
});

it('for manjaro for 4.4.2', async () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);

Expand Down

0 comments on commit 51cca3e

Please sign in to comment.