mirror of
https://github.com/Azure/setup-helm.git
synced 2026-04-06 06:29:27 +00:00
switching to fetching latest version from the dedicated file (#130)
This commit is contained in:
parent
efbd96d464
commit
ec8dd7c209
3 changed files with 17 additions and 29 deletions
|
|
@ -86,7 +86,18 @@ describe('run.ts', () => {
|
|||
expect(os.type).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('getLatestHelmVersion() - return the stable version of HELM since its not authenticated', async () => {
|
||||
test('getLatestHelmVersion() - return the latest version of HELM', async () => {
|
||||
const res = {
|
||||
status: 200,
|
||||
text: async () => 'v9.99.999'
|
||||
} as Response
|
||||
global.fetch = jest.fn().mockReturnValue(res)
|
||||
expect(await run.getLatestHelmVersion()).toBe('v9.99.999')
|
||||
})
|
||||
|
||||
test('getLatestHelmVersion() - return the stable version of HELM when simulating a network error', async () => {
|
||||
const errorMessage: string = 'Network Error'
|
||||
global.fetch = jest.fn().mockRejectedValueOnce(new Error(errorMessage))
|
||||
expect(await run.getLatestHelmVersion()).toBe('v3.13.3')
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue