mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-08 20:38: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:
parent
e348410e00
commit
6ed2c67c8a
4 changed files with 91 additions and 9 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue