mirror of
				https://gitea.com/actions/setup-python.git
				synced 2025-11-04 13:48:55 +08: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:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user