|
| 1 | +import { LinuxOS } from '../getos'; |
1 | 2 | import MongoBinaryDownloadUrl from '../MongoBinaryDownloadUrl'; |
2 | 3 | import { defaultValues, ResolveConfigVariables, setDefaultValue } from '../resolveConfig'; |
3 | 4 |
|
@@ -203,6 +204,58 @@ describe('MongoBinaryDownloadUrl', () => { |
203 | 204 | ); |
204 | 205 | }); |
205 | 206 | }); |
| 207 | + |
| 208 | + describe('for LinuxMint', () => { |
| 209 | + let downloadUrl: MongoBinaryDownloadUrl; |
| 210 | + beforeEach(() => { |
| 211 | + downloadUrl = new MongoBinaryDownloadUrl({ |
| 212 | + platform: 'linux', |
| 213 | + arch: 'x64', |
| 214 | + version: '4.0.20', |
| 215 | + os: { |
| 216 | + os: 'linux', |
| 217 | + dist: 'Linux Mint', |
| 218 | + release: '', |
| 219 | + id_like: 'ubuntu', |
| 220 | + }, |
| 221 | + }); |
| 222 | + }); |
| 223 | + |
| 224 | + it('should default to Mint Version 20, if version cannot be found in lookup table', async () => { |
| 225 | + (downloadUrl.os as LinuxOS).release = '16'; |
| 226 | + expect(await downloadUrl.getDownloadUrl()).toBe( |
| 227 | + 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.20.tgz' |
| 228 | + ); |
| 229 | + }); |
| 230 | + |
| 231 | + it('should return a archive name for Linux Mint 17', async () => { |
| 232 | + (downloadUrl.os as LinuxOS).release = '17'; |
| 233 | + expect(await downloadUrl.getDownloadUrl()).toBe( |
| 234 | + 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-4.0.20.tgz' |
| 235 | + ); |
| 236 | + }); |
| 237 | + |
| 238 | + it('should return a archive name for Linux Mint 18', async () => { |
| 239 | + (downloadUrl.os as LinuxOS).release = '18'; |
| 240 | + expect(await downloadUrl.getDownloadUrl()).toBe( |
| 241 | + 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.0.20.tgz' |
| 242 | + ); |
| 243 | + }); |
| 244 | + |
| 245 | + it('should return a archive name for Linux Mint 19', async () => { |
| 246 | + (downloadUrl.os as LinuxOS).release = '19'; |
| 247 | + expect(await downloadUrl.getDownloadUrl()).toBe( |
| 248 | + 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.20.tgz' |
| 249 | + ); |
| 250 | + }); |
| 251 | + |
| 252 | + it('should return a archive name for Linux Mint 20', async () => { |
| 253 | + (downloadUrl.os as LinuxOS).release = '20'; |
| 254 | + expect(await downloadUrl.getDownloadUrl()).toBe( |
| 255 | + 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.20.tgz' |
| 256 | + ); |
| 257 | + }); |
| 258 | + }); |
206 | 259 | }); |
207 | 260 |
|
208 | 261 | describe('for win32 & windows', () => { |
@@ -451,84 +504,7 @@ describe('MongoBinaryDownloadUrl', () => { |
451 | 504 | }); |
452 | 505 | }); |
453 | 506 |
|
454 | | - describe('getMintVersionString', () => { |
455 | | - const downloadUrl = new MongoBinaryDownloadUrl({ |
456 | | - platform: 'linux', |
457 | | - arch: 'x64', |
458 | | - version: '4.0.20', |
459 | | - }); |
460 | | - |
461 | | - it('should default to Mint Version 20, if version cannot be found in lookup table', () => { |
462 | | - expect( |
463 | | - downloadUrl.getMintVersionString({ |
464 | | - os: 'linux', |
465 | | - dist: 'Linux Mint', |
466 | | - release: '16', |
467 | | - }) |
468 | | - ).toBe('ubuntu1804'); |
469 | | - }); |
470 | | - |
471 | | - it('should return a archive name for Linux Mint 17', () => { |
472 | | - expect( |
473 | | - downloadUrl.getMintVersionString({ |
474 | | - os: 'linux', |
475 | | - dist: 'Linux Mint', |
476 | | - release: '17', |
477 | | - }) |
478 | | - ).toBe('ubuntu1404'); |
479 | | - }); |
480 | | - |
481 | | - it('should return a archive name for Linux Mint 18', () => { |
482 | | - expect( |
483 | | - downloadUrl.getMintVersionString({ |
484 | | - os: 'linux', |
485 | | - dist: 'Linux Mint', |
486 | | - release: '18', |
487 | | - }) |
488 | | - ).toBe('ubuntu1604'); |
489 | | - }); |
490 | | - |
491 | | - it('should return a archive name for Linux Mint 19', () => { |
492 | | - expect( |
493 | | - downloadUrl.getMintVersionString({ |
494 | | - os: 'linux', |
495 | | - dist: 'LinuxMint', |
496 | | - release: '19', |
497 | | - }) |
498 | | - ).toBe('ubuntu1804'); |
499 | | - }); |
500 | | - |
501 | | - it('should return a archive name for Linux Mint 20', () => { |
502 | | - expect( |
503 | | - downloadUrl.getMintVersionString({ |
504 | | - os: 'linux', |
505 | | - dist: 'Linux Mint', |
506 | | - release: '20', |
507 | | - }) |
508 | | - ).toBe('ubuntu1804'); |
509 | | - }); |
510 | | - }); |
511 | | - |
512 | | - it('shouldnt detect linux mint when using peppermint', () => { |
513 | | - jest.spyOn(console, 'warn').mockImplementation(() => void 0); |
514 | | - const downloadUrl = new MongoBinaryDownloadUrl({ |
515 | | - platform: 'linux', |
516 | | - arch: 'x64', |
517 | | - version: '3.6.3', |
518 | | - }); |
519 | | - |
520 | | - expect( |
521 | | - downloadUrl.getLinuxOSVersionString({ |
522 | | - os: 'linux', |
523 | | - dist: 'Peppermint', |
524 | | - release: '10', |
525 | | - }) |
526 | | - ).toBe(''); |
527 | | - |
528 | | - expect(console.warn).toHaveBeenCalledTimes(1); |
529 | | - }); |
530 | | - |
531 | | - describe('getLegacyVersionString', () => { |
| 507 | + describe('getLegacyVersionString()', () => { |
532 | 508 | const downloadUrl = new MongoBinaryDownloadUrl({ |
533 | 509 | platform: 'linux', |
534 | 510 | arch: 'x64', |
|
0 commit comments