Upgrade to node 24 (#888) · actions/setup-java@0913e9a (original) (raw)
`@@ -98,31 +98,35 @@ describe('findPackageForDownload', () => {
`
98
98
`});
`
99
99
``
100
100
`it.each([
`
101
``
`-
['amd64', 'x64'],
`
102
``
`-
['arm64', 'aarch64']
`
``
101
`+
['amd64', ['x64', 'amd64']],
`
``
102
`+
['arm64', ['aarch64', 'arm64']]
`
103
103
`])(
`
104
104
`'defaults to os.arch(): %s mapped to distro arch: %s',
`
105
``
`-
async (osArch: string, distroArch: string) => {
`
106
``
`-
jest.spyOn(os, 'arch').mockReturnValue(osArch);
`
107
``
`-
jest.spyOn(os, 'platform').mockReturnValue('linux');
`
``
105
`+
async (osArch: string, distroArchs: string[]) => {
`
``
106
`+
jest
`
``
107
`+
.spyOn(os, 'arch')
`
``
108
`+
.mockReturnValue(osArch as ReturnType);
`
108
109
``
109
``
`-
const version = '21';
`
110
``
`-
const distro = new GraalVMDistribution({
`
111
``
`-
version,
`
``
110
`+
const distribution = new GraalVMDistribution({
`
``
111
`+
version: '21',
`
112
112
`architecture: '', // to get default value
`
113
113
`packageType: 'jdk',
`
114
114
`checkLatest: false
`
115
115
`});
`
116
116
``
117
117
`const osType = distribution.getPlatform();
`
118
``
`-
if (osType === 'windows' && distroArch == 'aarch64') {
`
``
118
`+
if (osType === 'windows' && distroArchs.includes('aarch64')) {
`
119
119
`return; // skip, aarch64 is not available for Windows
`
120
120
`}
`
121
121
`const archiveType = getDownloadArchiveExtension();
`
122
``
`-
const result = await distro'findPackageForDownload';
`
123
``
`` -
const expectedUrl = https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType};
``
``
122
`+
const result = await distribution'findPackageForDownload';
`
124
123
``
125
``
`-
expect(result.url).toBe(expectedUrl);
`
``
124
`+
const expectedUrls = distroArchs.map(
`
``
125
`+
distroArch =>
`
``
126
`` +
https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}
``
``
127
`+
);
`
``
128
+
``
129
`+
expect(expectedUrls).toContain(result.url);
`
126
130
`}
`
127
131
`);
`
128
132
``