mirror of
https://github.com/actions/setup-java.git
synced 2025-04-22 02:46:46 +00:00
Simplify solution and unit-tests
This commit is contained in:
parent
36571034fa
commit
3fb9de05e9
8 changed files with 4358 additions and 4384 deletions
|
@ -241,22 +241,3 @@ describe('getAvailableVersions', () => {
|
|||
spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
||||
};
|
||||
});
|
||||
|
||||
describe('convertVersionToSemver', () => {
|
||||
it.each([
|
||||
['12', '12'],
|
||||
['12.0', '12.0'],
|
||||
['12.0.2', '12.0.2'],
|
||||
['12.0.2.1', '12.0.2+1'],
|
||||
['12.0.2.1.0', '12.0.2+1.0']
|
||||
])('%s -> %s', (input: string, expected: string) => {
|
||||
const distribution = new CorrettoDistribution({
|
||||
version: '12',
|
||||
architecture: 'x86',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
const actual = distribution['convertVersionToSemver'](input);
|
||||
expect(actual).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -227,22 +227,3 @@ describe('findPackageForDownload', () => {
|
|||
).rejects.toThrow(/Could not find satisfied version for semver */);
|
||||
});
|
||||
});
|
||||
|
||||
describe('convertVersionToSemver', () => {
|
||||
it.each([
|
||||
[[12], '12'],
|
||||
[[12, 0], '12.0'],
|
||||
[[12, 0, 2], '12.0.2'],
|
||||
[[12, 0, 2, 1], '12.0.2+1'],
|
||||
[[12, 0, 2, 1, 3], '12.0.2+1']
|
||||
])('%s -> %s', (input: number[], expected: string) => {
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '18',
|
||||
architecture: 'x86',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
const actual = distribution['convertVersionToSemver'](input);
|
||||
expect(actual).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue