1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-09 21:02:19 +02:00

Fix for Candidate Not Iterable Error (#1082)

* candidates not iterable

* update the error message

* update error to debug

* update debug to info

* error message updates
This commit is contained in:
aparnajyothi-y 2025-04-17 19:25:44 +05:30 committed by Aparna Jyothi
parent 56f2fac840
commit 358da85d3a
4 changed files with 91 additions and 9 deletions

View file

@ -8,10 +8,29 @@ import * as tc from '@actions/tool-cache';
jest.mock('@actions/http-client');
jest.mock('@actions/tool-cache');
const mockManifest = [{version: '1.0.0'}];
jest.mock('@actions/tool-cache', () => ({
getManifestFromRepo: jest.fn()
}));
const mockManifest = [
{
version: '1.0.0',
stable: true,
files: [
{
filename: 'tool-v1.0.0-linux-x64.tar.gz',
platform: 'linux',
arch: 'x64',
download_url: 'https://example.com/tool-v1.0.0-linux-x64.tar.gz'
}
]
}
];
describe('getManifest', () => {
beforeEach(() => {
jest.resetAllMocks();
});
it('should return manifest from repo', async () => {
(tc.getManifestFromRepo as jest.Mock).mockResolvedValue(mockManifest);
const manifest = await getManifest();