@@ -90,7 +90,7 @@ describe('Testing all functions in run file.', () => {
90
90
91
91
expect ( await run . getStableKubectlVersion ( ) ) . toBe ( 'v1.20.4' )
92
92
expect ( toolCache . downloadTool ) . toBeCalled ( )
93
- expect ( fs . readFileSync ) . toBeCalledWith ( 'pathToTool' , 'utf8' )
93
+ expect ( fs . readFileSync ) . toHaveBeenCalledWith ( 'pathToTool' , 'utf8' )
94
94
} )
95
95
96
96
test ( 'getStableKubectlVersion() - return default v1.15.0 if version read is empty' , async ( ) => {
@@ -101,7 +101,7 @@ describe('Testing all functions in run file.', () => {
101
101
102
102
expect ( await run . getStableKubectlVersion ( ) ) . toBe ( 'v1.15.0' )
103
103
expect ( toolCache . downloadTool ) . toBeCalled ( )
104
- expect ( fs . readFileSync ) . toBeCalledWith ( 'pathToTool' , 'utf8' )
104
+ expect ( fs . readFileSync ) . toHaveBeenCalledWith ( 'pathToTool' , 'utf8' )
105
105
} )
106
106
107
107
test ( 'getStableKubectlVersion() - return default v1.15.0 if unable to download file' , async ( ) => {
@@ -127,11 +127,11 @@ describe('Testing all functions in run file.', () => {
127
127
expect ( await run . downloadKubectl ( 'v1.15.0' ) ) . toBe (
128
128
path . join ( 'pathToCachedTool' , 'kubectl.exe' )
129
129
)
130
- expect ( toolCache . find ) . toBeCalledWith ( 'kubectl' , 'v1.15.0' )
130
+ expect ( toolCache . find ) . toHaveBeenCalledWith ( 'kubectl' , 'v1.15.0' )
131
131
expect ( toolCache . downloadTool ) . toBeCalled ( )
132
132
expect ( toolCache . cacheFile ) . toBeCalled ( )
133
133
expect ( os . type ) . toBeCalled ( )
134
- expect ( fs . chmodSync ) . toBeCalledWith (
134
+ expect ( fs . chmodSync ) . toHaveBeenCalledWith (
135
135
path . join ( 'pathToCachedTool' , 'kubectl.exe' ) ,
136
136
'775'
137
137
)
@@ -146,7 +146,7 @@ describe('Testing all functions in run file.', () => {
146
146
await expect ( run . downloadKubectl ( 'v1.15.0' ) ) . rejects . toThrow (
147
147
'DownloadKubectlFailed'
148
148
)
149
- expect ( toolCache . find ) . toBeCalledWith ( 'kubectl' , 'v1.15.0' )
149
+ expect ( toolCache . find ) . toHaveBeenCalledWith ( 'kubectl' , 'v1.15.0' )
150
150
expect ( toolCache . downloadTool ) . toBeCalled ( )
151
151
} )
152
152
@@ -168,7 +168,7 @@ describe('Testing all functions in run file.', () => {
168
168
)
169
169
)
170
170
expect ( os . arch ) . toBeCalled ( )
171
- expect ( toolCache . find ) . toBeCalledWith ( 'kubectl' , kubectlVersion )
171
+ expect ( toolCache . find ) . toHaveBeenCalledWith ( 'kubectl' , kubectlVersion )
172
172
expect ( toolCache . downloadTool ) . toBeCalled ( )
173
173
} )
174
174
@@ -181,9 +181,9 @@ describe('Testing all functions in run file.', () => {
181
181
expect ( await run . downloadKubectl ( 'v1.15.0' ) ) . toBe (
182
182
path . join ( 'pathToCachedTool' , 'kubectl.exe' )
183
183
)
184
- expect ( toolCache . find ) . toBeCalledWith ( 'kubectl' , 'v1.15.0' )
184
+ expect ( toolCache . find ) . toHaveBeenCalledWith ( 'kubectl' , 'v1.15.0' )
185
185
expect ( os . type ) . toBeCalled ( )
186
- expect ( fs . chmodSync ) . toBeCalledWith (
186
+ expect ( fs . chmodSync ) . toHaveBeenCalledWith (
187
187
path . join ( 'pathToCachedTool' , 'kubectl.exe' ) ,
188
188
'775'
189
189
)
@@ -200,9 +200,9 @@ describe('Testing all functions in run file.', () => {
200
200
jest . spyOn ( core , 'setOutput' ) . mockImplementation ( )
201
201
202
202
expect ( await run . run ( ) ) . toBeUndefined ( )
203
- expect ( core . getInput ) . toBeCalledWith ( 'version' , { required : true } )
204
- expect ( core . addPath ) . toBeCalledWith ( 'pathToCachedTool' )
205
- expect ( core . setOutput ) . toBeCalledWith (
203
+ expect ( core . getInput ) . toHaveBeenCalledWith ( 'version' , { required : true } )
204
+ expect ( core . addPath ) . toHaveBeenCalledWith ( 'pathToCachedTool' )
205
+ expect ( core . setOutput ) . toHaveBeenCalledWith (
206
206
'kubectl-path' ,
207
207
path . join ( 'pathToCachedTool' , 'kubectl.exe' )
208
208
)
@@ -222,12 +222,12 @@ describe('Testing all functions in run file.', () => {
222
222
jest . spyOn ( core , 'setOutput' ) . mockImplementation ( )
223
223
224
224
expect ( await run . run ( ) ) . toBeUndefined ( )
225
- expect ( toolCache . downloadTool ) . toBeCalledWith (
225
+ expect ( toolCache . downloadTool ) . toHaveBeenCalledWith (
226
226
'https://storage.googleapis.com/kubernetes-release/release/stable.txt'
227
227
)
228
- expect ( core . getInput ) . toBeCalledWith ( 'version' , { required : true } )
229
- expect ( core . addPath ) . toBeCalledWith ( 'pathToCachedTool' )
230
- expect ( core . setOutput ) . toBeCalledWith (
228
+ expect ( core . getInput ) . toHaveBeenCalledWith ( 'version' , { required : true } )
229
+ expect ( core . addPath ) . toHaveBeenCalledWith ( 'pathToCachedTool' )
230
+ expect ( core . setOutput ) . toHaveBeenCalledWith (
231
231
'kubectl-path' ,
232
232
path . join ( 'pathToCachedTool' , 'kubectl.exe' )
233
233
)
0 commit comments