@@ -98,15 +98,15 @@ describe('setup-go', () => {
98
98
logSpy = jest . spyOn ( core , 'info' ) ;
99
99
dbgSpy = jest . spyOn ( core , 'debug' ) ;
100
100
getSpy . mockImplementation ( ( ) => < im . IGoVersion [ ] | null > goJsonData ) ;
101
- cnSpy . mockImplementation ( line => {
101
+ cnSpy . mockImplementation ( ( line ) => {
102
102
// uncomment to debug
103
103
// process.stderr.write('write:' + line + '\n');
104
104
} ) ;
105
- logSpy . mockImplementation ( line => {
105
+ logSpy . mockImplementation ( ( line ) => {
106
106
// uncomment to debug
107
107
//process.stderr.write('log:' + line + '\n');
108
108
} ) ;
109
- dbgSpy . mockImplementation ( msg => {
109
+ dbgSpy . mockImplementation ( ( line ) => {
110
110
// uncomment to see debug output
111
111
// process.stderr.write(msg + '\n');
112
112
} ) ;
@@ -295,7 +295,6 @@ describe('setup-go', () => {
295
295
findSpy . mockImplementation ( ( ) => toolPath ) ;
296
296
await main . run ( ) ;
297
297
298
- let expPath = path . join ( toolPath , 'bin' ) ;
299
298
expect ( logSpy ) . toHaveBeenCalledWith ( `Found in cache @ ${ toolPath } ` ) ;
300
299
} ) ;
301
300
@@ -462,9 +461,6 @@ describe('setup-go', () => {
462
461
inputs [ 'go-version' ] = versionSpec ;
463
462
inputs [ 'token' ] = 'faketoken' ;
464
463
465
- let expectedUrl =
466
- 'https://github.com/actions/go-versions/releases/download/1.12.14-20200616.18/go-1.12.14-linux-x64.tar.gz' ;
467
-
468
464
// ... but not in the local cache
469
465
findSpy . mockImplementation ( ( ) => '' ) ;
470
466
@@ -526,7 +522,7 @@ describe('setup-go', () => {
526
522
} ) ;
527
523
528
524
mkdirpSpy . mockImplementation ( async ( ) => { } ) ;
529
- existsSpy . mockImplementation ( path => {
525
+ existsSpy . mockImplementation ( ( ) => {
530
526
return false ;
531
527
} ) ;
532
528
@@ -707,8 +703,6 @@ describe('setup-go', () => {
707
703
const toolPath = path . normalize ( '/cache/go/1.17.5/x64' ) ;
708
704
extractTarSpy . mockImplementation ( async ( ) => '/some/other/temp/path' ) ;
709
705
cacheSpy . mockImplementation ( async ( ) => toolPath ) ;
710
- const expectedUrl =
711
- 'https://github.com/actions/go-versions/releases/download/1.17.6-1668090892/go-1.17.6-darwin-x64.tar.gz' ;
712
706
713
707
await main . run ( ) ;
714
708
@@ -834,7 +828,7 @@ exclude example.com/thismodule v1.3.0
834
828
835
829
it ( 'reads version from go.mod' , async ( ) => {
836
830
inputs [ 'go-version-file' ] = 'go.mod' ;
837
- existsSpy . mockImplementation ( path => true ) ;
831
+ existsSpy . mockImplementation ( ( ) => true ) ;
838
832
readFileSpy . mockImplementation ( ( ) => Buffer . from ( goModContents ) ) ;
839
833
840
834
await main . run ( ) ;
@@ -846,7 +840,7 @@ exclude example.com/thismodule v1.3.0
846
840
847
841
it ( 'reads version from .go-version' , async ( ) => {
848
842
inputs [ 'go-version-file' ] = '.go-version' ;
849
- existsSpy . mockImplementation ( path => true ) ;
843
+ existsSpy . mockImplementation ( ( ) => true ) ;
850
844
readFileSpy . mockImplementation ( ( ) => Buffer . from ( `1.13.0${ osm . EOL } ` ) ) ;
851
845
852
846
await main . run ( ) ;
@@ -859,7 +853,7 @@ exclude example.com/thismodule v1.3.0
859
853
it ( 'is overwritten by go-version' , async ( ) => {
860
854
inputs [ 'go-version' ] = '1.13.1' ;
861
855
inputs [ 'go-version-file' ] = 'go.mod' ;
862
- existsSpy . mockImplementation ( path => true ) ;
856
+ existsSpy . mockImplementation ( ( ) => true ) ;
863
857
readFileSpy . mockImplementation ( ( ) => Buffer . from ( goModContents ) ) ;
864
858
865
859
await main . run ( ) ;
@@ -871,7 +865,7 @@ exclude example.com/thismodule v1.3.0
871
865
872
866
it ( 'reports a read failure' , async ( ) => {
873
867
inputs [ 'go-version-file' ] = 'go.mod' ;
874
- existsSpy . mockImplementation ( path => false ) ;
868
+ existsSpy . mockImplementation ( ( ) => false ) ;
875
869
876
870
await main . run ( ) ;
877
871
0 commit comments