@@ -8,8 +8,7 @@ import * as stateHelper from '../src/state-helper';
8
8
import * as core from '@actions/core' ;
9
9
10
10
test ( 'errors without username and password' , async ( ) => {
11
- const platSpy = jest . spyOn ( osm , 'platform' ) . mockImplementation ( ( ) => 'linux' ) ;
12
-
11
+ jest . spyOn ( osm , 'platform' ) . mockImplementation ( ( ) => 'linux' ) ;
13
12
process . env [ 'INPUT_LOGOUT' ] = 'true' ; // default value
14
13
const coreSpy = jest . spyOn ( core , 'setFailed' ) ;
15
14
@@ -18,21 +17,21 @@ test('errors without username and password', async () => {
18
17
} ) ;
19
18
20
19
test ( 'successful with username and password' , async ( ) => {
21
- const platSpy = jest . spyOn ( osm , 'platform' ) . mockImplementation ( ( ) => 'linux' ) ;
20
+ jest . spyOn ( osm , 'platform' ) . mockImplementation ( ( ) => 'linux' ) ;
22
21
const setRegistrySpy = jest . spyOn ( stateHelper , 'setRegistry' ) ;
23
22
const setLogoutSpy = jest . spyOn ( stateHelper , 'setLogout' ) ;
24
23
const dockerSpy = jest . spyOn ( docker , 'login' ) . mockImplementation ( jest . fn ( ) ) ;
25
24
26
- const username : string = 'dbowie' ;
25
+ const username = 'dbowie' ;
27
26
process . env [ `INPUT_USERNAME` ] = username ;
28
27
29
- const password : string = 'groundcontrol' ;
28
+ const password = 'groundcontrol' ;
30
29
process . env [ `INPUT_PASSWORD` ] = password ;
31
30
32
- const ecr : string = 'auto' ;
31
+ const ecr = 'auto' ;
33
32
process . env [ 'INPUT_ECR' ] = ecr ;
34
33
35
- const logout : boolean = false ;
34
+ const logout = false ;
36
35
process . env [ 'INPUT_LOGOUT' ] = String ( logout ) ;
37
36
38
37
await run ( ) ;
@@ -43,25 +42,25 @@ test('successful with username and password', async () => {
43
42
} ) ;
44
43
45
44
test ( 'calls docker login' , async ( ) => {
46
- const platSpy = jest . spyOn ( osm , 'platform' ) . mockImplementation ( ( ) => 'linux' ) ;
45
+ jest . spyOn ( osm , 'platform' ) . mockImplementation ( ( ) => 'linux' ) ;
47
46
const setRegistrySpy = jest . spyOn ( stateHelper , 'setRegistry' ) ;
48
47
const setLogoutSpy = jest . spyOn ( stateHelper , 'setLogout' ) ;
49
48
const dockerSpy = jest . spyOn ( docker , 'login' ) ;
50
49
dockerSpy . mockImplementation ( jest . fn ( ) ) ;
51
50
52
- const username : string = 'dbowie' ;
51
+ const username = 'dbowie' ;
53
52
process . env [ `INPUT_USERNAME` ] = username ;
54
53
55
- const password : string = 'groundcontrol' ;
54
+ const password = 'groundcontrol' ;
56
55
process . env [ `INPUT_PASSWORD` ] = password ;
57
56
58
- const registry : string = 'ghcr.io' ;
57
+ const registry = 'ghcr.io' ;
59
58
process . env [ `INPUT_REGISTRY` ] = registry ;
60
59
61
- const ecr : string = 'auto' ;
60
+ const ecr = 'auto' ;
62
61
process . env [ 'INPUT_ECR' ] = ecr ;
63
62
64
- const logout : boolean = true ;
63
+ const logout = true ;
65
64
process . env [ 'INPUT_LOGOUT' ] = String ( logout ) ;
66
65
67
66
await run ( ) ;
0 commit comments