@@ -67,7 +67,7 @@ describe('run.ts', () => {
67
67
expect ( os . arch ) . toHaveBeenCalled ( )
68
68
} )
69
69
70
- test ( 'getHelmDownloadURL() - return the URL to download helm for Windows' , ( ) => {
70
+ test ( 'getHelmDownloadURL() - return the URL to download helm for Windows x64 ' , ( ) => {
71
71
jest . spyOn ( os , 'platform' ) . mockReturnValue ( 'win32' )
72
72
jest . spyOn ( os , 'arch' ) . mockReturnValue ( 'x64' )
73
73
@@ -76,6 +76,15 @@ describe('run.ts', () => {
76
76
expect ( os . platform ) . toHaveBeenCalled ( )
77
77
} )
78
78
79
+ test ( 'getHelmDownloadURL() - return the URL to download helm for Windows arm64' , ( ) => {
80
+ jest . spyOn ( os , 'platform' ) . mockReturnValue ( 'win32' )
81
+ jest . spyOn ( os , 'arch' ) . mockReturnValue ( 'arm64' )
82
+
83
+ const expected = 'https://test.tld/helm-v3.8.0-windows-arm64.zip'
84
+ expect ( run . getHelmDownloadURL ( downloadBaseURL , 'v3.8.0' ) ) . toBe ( expected )
85
+ expect ( os . platform ) . toHaveBeenCalled ( )
86
+ } )
87
+
79
88
test ( 'getLatestHelmVersion() - return the latest version of HELM' , async ( ) => {
80
89
const res = {
81
90
status : 200 ,
@@ -88,7 +97,7 @@ describe('run.ts', () => {
88
97
test ( 'getLatestHelmVersion() - return the stable version of HELM when simulating a network error' , async ( ) => {
89
98
const errorMessage : string = 'Network Error'
90
99
global . fetch = jest . fn ( ) . mockRejectedValueOnce ( new Error ( errorMessage ) )
91
- expect ( await run . getLatestHelmVersion ( ) ) . toBe ( 'v3.13.3' )
100
+ expect ( await run . getLatestHelmVersion ( ) ) . toBe ( run . stableHelmVersion )
92
101
} )
93
102
94
103
test ( 'getValidVersion() - return version with v prepended' , ( ) => {
@@ -204,6 +213,7 @@ describe('run.ts', () => {
204
213
const response = JSON . stringify ( [ { tag_name : 'v4.0.0' } ] )
205
214
jest . spyOn ( fs , 'readFileSync' ) . mockReturnValue ( response )
206
215
jest . spyOn ( os , 'platform' ) . mockReturnValue ( 'win32' )
216
+ jest . spyOn ( os , 'arch' ) . mockReturnValue ( 'x64' )
207
217
jest . spyOn ( fs , 'chmodSync' ) . mockImplementation ( ( ) => { } )
208
218
jest . spyOn ( toolCache , 'extractZip' ) . mockResolvedValue ( 'extractedPath' )
209
219
jest . spyOn ( toolCache , 'cacheDir' ) . mockResolvedValue ( 'pathToCachedDir' )
@@ -239,6 +249,7 @@ describe('run.ts', () => {
239
249
throw 'Unable to download'
240
250
} )
241
251
jest . spyOn ( os , 'platform' ) . mockReturnValue ( 'win32' )
252
+ jest . spyOn ( os , 'arch' ) . mockReturnValue ( 'x64' )
242
253
243
254
const downloadUrl = 'https://test.tld/helm-v3.2.1-windows-amd64.zip'
244
255
await expect ( run . downloadHelm ( downloadBaseURL , 'v3.2.1' ) ) . rejects . toThrow (
@@ -254,6 +265,7 @@ describe('run.ts', () => {
254
265
jest . spyOn ( toolCache , 'downloadTool' ) . mockResolvedValue ( 'pathToTool' )
255
266
jest . spyOn ( toolCache , 'extractZip' ) . mockResolvedValue ( 'extractedPath' )
256
267
jest . spyOn ( os , 'platform' ) . mockReturnValue ( 'win32' )
268
+ jest . spyOn ( os , 'arch' ) . mockReturnValue ( 'x64' )
257
269
jest . spyOn ( fs , 'chmodSync' ) . mockImplementation ( ( ) => { } )
258
270
jest
259
271
. spyOn ( fs , 'readdirSync' )
@@ -283,6 +295,7 @@ describe('run.ts', () => {
283
295
jest . spyOn ( toolCache , 'downloadTool' ) . mockResolvedValue ( 'pathToTool' )
284
296
jest . spyOn ( toolCache , 'extractZip' ) . mockResolvedValue ( 'extractedPath' )
285
297
jest . spyOn ( os , 'platform' ) . mockReturnValue ( 'win32' )
298
+ jest . spyOn ( os , 'arch' ) . mockReturnValue ( 'x64' )
286
299
jest . spyOn ( fs , 'chmodSync' ) . mockImplementation ( )
287
300
jest . spyOn ( fs , 'readdirSync' ) . mockImplementation ( ( file , _ ) => [ ] )
288
301
jest . spyOn ( fs , 'statSync' ) . mockImplementation ( ( file ) => {
0 commit comments