mirror of
https://code.forgejo.org/actions/setup-go
synced 2025-06-08 11:38:22 +02:00
another test
This commit is contained in:
parent
241a335117
commit
6cb99a33d7
3 changed files with 36 additions and 9 deletions
|
@ -108,6 +108,38 @@ describe('setup-go', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('reports a failed download', async () => {
|
||||
let errMsg = 'unhandled download message';
|
||||
platSpy.mockImplementation(() => 'linux');
|
||||
archSpy.mockImplementation(() => 'x64');
|
||||
|
||||
inSpy.mockImplementation(() => '1.13.1');
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(() => {
|
||||
throw new Error(errMsg);
|
||||
});
|
||||
await run();
|
||||
|
||||
expect(cnSpy).toHaveBeenCalledWith(
|
||||
`::error::Failed to download version 1.13.1: Error: ${errMsg}${os.EOL}`
|
||||
);
|
||||
});
|
||||
|
||||
it('reports empty query results', async () => {
|
||||
let errMsg = 'unhandled download message';
|
||||
platSpy.mockImplementation(() => 'linux');
|
||||
archSpy.mockImplementation(() => 'x64');
|
||||
|
||||
inSpy.mockImplementation(() => '1.13.1');
|
||||
findSpy.mockImplementation(() => '');
|
||||
getSpy.mockImplementation(() => null);
|
||||
await run();
|
||||
|
||||
expect(cnSpy).toHaveBeenCalledWith(
|
||||
`::error::Failed to download version 1.13.1: Error: golang download url did not return results${os.EOL}`
|
||||
);
|
||||
});
|
||||
|
||||
it('can query versions', async () => {
|
||||
let versions: im.IGoVersion[] | null = await im.getVersions(
|
||||
'https://non.existant.com/path'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue