fix tests

This commit is contained in:
Salman Muin Kayser Chishti 2025-07-31 20:32:42 +01:00
commit bb39e340a4
14 changed files with 72 additions and 18 deletions

View file

@ -1,5 +1,9 @@
import {GraalVMDistribution} from '../../src/distributions/graalvm/installer';
import os from 'os';
function mockArchitecture(arch: string): NodeJS.Architecture {
return arch as NodeJS.Architecture;
}
import * as core from '@actions/core';
import {getDownloadArchiveExtension} from '../../src/util';
import {HttpClient} from '@actions/http-client';
@ -103,7 +107,7 @@ describe('findPackageForDownload', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
jest.spyOn(os, 'arch').mockReturnValue(osArch);
jest.spyOn(os, 'arch').mockReturnValue(mockArchitecture(osArch));
jest.spyOn(os, 'platform').mockReturnValue('linux');
const version = '21';