@@ -10,6 +10,8 @@ test('errors without username and password', async () => {
1010 const platSpy = jest . spyOn ( osm , 'platform' ) ;
1111 platSpy . mockImplementation ( ( ) => 'linux' ) ;
1212
13+ process . env [ 'INPUT_LOGOUT' ] = 'true' ; // default value
14+
1315 const coreSpy : jest . SpyInstance = jest . spyOn ( core , 'setFailed' ) ;
1416
1517 await run ( ) ;
@@ -32,10 +34,13 @@ test('successful with username and password', async () => {
3234 const password : string = 'groundcontrol' ;
3335 process . env [ `INPUT_PASSWORD` ] = password ;
3436
37+ const logout : boolean = false ;
38+ process . env [ 'INPUT_LOGOUT' ] = String ( logout ) ;
39+
3540 await run ( ) ;
3641
3742 expect ( setRegistrySpy ) . toHaveBeenCalledWith ( '' ) ;
38- expect ( setLogoutSpy ) . toHaveBeenCalledWith ( '' ) ;
43+ expect ( setLogoutSpy ) . toHaveBeenCalledWith ( logout ) ;
3944 expect ( dockerSpy ) . toHaveBeenCalledWith ( '' , username , password ) ;
4045} ) ;
4146
@@ -57,8 +62,8 @@ test('calls docker login', async () => {
5762 const registry : string = 'ghcr.io' ;
5863 process . env [ `INPUT_REGISTRY` ] = registry ;
5964
60- const logout : string = ' true' ;
61- process . env [ 'INPUT_LOGOUT' ] = logout ;
65+ const logout : boolean = true ;
66+ process . env [ 'INPUT_LOGOUT' ] = String ( logout ) ;
6267
6368 await run ( ) ;
6469
0 commit comments