feat: add check for the package type, update unit tests

This commit is contained in:
Ivan Zosimov 2023-09-13 15:54:22 +02:00
parent 8036ba5657
commit 2c43893557
3 changed files with 24 additions and 0 deletions

View file

@ -206,5 +206,22 @@ describe('getAvailableVersions', () => {
);
}
);
it('should throw when required package type is not jdk', async () => {
const jdkVersion = '17';
const arch = 'x64';
const platform = 'linux';
const distribution = new DragonwellDistribution({
version: jdkVersion,
architecture: arch,
packageType: 'jre',
checkLatest: false
});
mockPlatform(distribution, platform);
await expect(
distribution['findPackageForDownload'](jdkVersion)
).rejects.toThrow('Dragonwell provides only the `jdk` package type');
});
});
});