@@ -26,8 +26,8 @@ describe('setup-go', () => {
2626 findSpy = jest . spyOn ( tc , 'find' ) ;
2727 inSpy = jest . spyOn ( core , 'getInput' ) ;
2828 cnSpy = jest . spyOn ( process . stdout , 'write' ) ;
29- platSpy = jest . spyOn ( sys , 'getPlatform ' ) ;
30- archSpy = jest . spyOn ( sys , 'getArch ' ) ;
29+ platSpy = jest . spyOn ( os , 'platform ' ) ;
30+ archSpy = jest . spyOn ( os , 'arch ' ) ;
3131 dlSpy = jest . spyOn ( tc , 'downloadTool' ) ;
3232 exSpy = jest . spyOn ( tc , 'extractTar' ) ;
3333 cacheSpy = jest . spyOn ( tc , 'cacheDir' ) ;
@@ -78,7 +78,7 @@ describe('setup-go', () => {
7878
7979 it ( 'downloads a version not in the cache' , async ( ) => {
8080 platSpy . mockImplementation ( ( ) => 'linux' ) ;
81- archSpy . mockImplementation ( ( ) => 'amd64 ' ) ;
81+ archSpy . mockImplementation ( ( ) => 'x64 ' ) ;
8282
8383 inSpy . mockImplementation ( ( ) => '1.13.1' ) ;
8484 findSpy . mockImplementation ( ( ) => '' ) ;
@@ -97,7 +97,7 @@ describe('setup-go', () => {
9797
9898 it ( 'does not find a version that does not exist' , async ( ) => {
9999 platSpy . mockImplementation ( ( ) => 'linux' ) ;
100- archSpy . mockImplementation ( ( ) => 'amd64 ' ) ;
100+ archSpy . mockImplementation ( ( ) => 'x64 ' ) ;
101101
102102 inSpy . mockImplementation ( ( ) => '9.99.9' ) ;
103103 findSpy . mockImplementation ( ( ) => '' ) ;
@@ -118,8 +118,8 @@ describe('setup-go', () => {
118118 } ) ;
119119
120120 it ( 'finds stable match for exact version' , async ( ) => {
121- platSpy . mockImplementation ( ( ) => 'windows ' ) ;
122- archSpy . mockImplementation ( ( ) => 'amd64 ' ) ;
121+ platSpy . mockImplementation ( ( ) => 'win32 ' ) ;
122+ archSpy . mockImplementation ( ( ) => 'x64 ' ) ;
123123
124124 // get request is already mocked
125125 // spec: 1.13.7 => 1.13.7 (exact)
@@ -133,7 +133,7 @@ describe('setup-go', () => {
133133
134134 it ( 'finds stable match for exact dot zero version' , async ( ) => {
135135 platSpy . mockImplementation ( ( ) => 'darwin' ) ;
136- archSpy . mockImplementation ( ( ) => 'amd64 ' ) ;
136+ archSpy . mockImplementation ( ( ) => 'x64 ' ) ;
137137
138138 // spec: 1.13.0 => 1.13
139139 let match : im . IGoVersion | undefined = await im . findMatch ( '1.13.0' , true ) ;
@@ -146,7 +146,7 @@ describe('setup-go', () => {
146146
147147 it ( 'finds latest patch version for minor version spec' , async ( ) => {
148148 platSpy . mockImplementation ( ( ) => 'linux' ) ;
149- archSpy . mockImplementation ( ( ) => 'amd64 ' ) ;
149+ archSpy . mockImplementation ( ( ) => 'x64 ' ) ;
150150 core . debug ( 'plat mocks ok' ) ;
151151
152152 // spec: 1.13 => 1.13.7 (latest)
@@ -160,7 +160,7 @@ describe('setup-go', () => {
160160
161161 it ( 'finds latest patch version for caret version spec' , async ( ) => {
162162 platSpy . mockImplementation ( ( ) => 'linux' ) ;
163- archSpy . mockImplementation ( ( ) => 'amd64 ' ) ;
163+ archSpy . mockImplementation ( ( ) => 'x64 ' ) ;
164164
165165 // spec: ^1.13.6 => 1.13.7
166166 let match : im . IGoVersion | undefined = await im . findMatch ( '^1.13.6' , true ) ;
@@ -172,15 +172,15 @@ describe('setup-go', () => {
172172 } ) ;
173173
174174 it ( 'finds latest version for major version spec' , async ( ) => {
175- platSpy . mockImplementation ( ( ) => 'linux ' ) ;
176- archSpy . mockImplementation ( ( ) => 'amd64 ' ) ;
175+ platSpy . mockImplementation ( ( ) => 'windows ' ) ;
176+ archSpy . mockImplementation ( ( ) => 'x32 ' ) ;
177177
178178 // spec: 1 => 1.13.7 (latest)
179179 let match : im . IGoVersion | undefined = await im . findMatch ( '1' , true ) ;
180180 expect ( match ) . toBeDefined ( ) ;
181181 let version : string = match ? match . version : '' ;
182182 expect ( version ) . toBe ( 'go1.13.7' ) ;
183183 let fileName = match ? match . files [ 0 ] . filename : '' ;
184- expect ( fileName ) . toBe ( 'go1.13.7.linux-amd64.tar.gz ' ) ;
184+ expect ( fileName ) . toBe ( 'go1.13.7.windows-386.zip ' ) ;
185185 } ) ;
186186} ) ;
0 commit comments