1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-15 07:24:14 +02:00

handled candidate not iterable error

This commit is contained in:
mahabaleshwars 2025-02-28 18:32:38 +05:30
parent 6ca8e8598f
commit 7c16f92757
3 changed files with 87 additions and 5 deletions

View file

@ -8,10 +8,30 @@ import * as tc from '@actions/tool-cache';
jest.mock('@actions/http-client');
jest.mock('@actions/tool-cache');
jest.mock('@actions/tool-cache', () => ({
getManifestFromRepo: jest.fn()
}));
const mockManifest = [{version: '1.0.0'}];
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();