@@ -44,7 +44,9 @@ jest.mock('../../lib/get_build_number');
44
44
45
45
expect . addSnapshotSerializer ( createAnyInstanceSerializer ( ToolingLog ) ) ;
46
46
47
- const { getNodeDownloadInfo } = jest . requireMock ( './node_download_info' ) ;
47
+ const { getNodeDownloadInfo, getNodeVersionDownloadInfo } = jest . requireMock (
48
+ './node_download_info'
49
+ ) ;
48
50
const { getNodeShasums } = jest . requireMock ( './node_shasums' ) ;
49
51
const { download } = jest . requireMock ( '../../lib/download' ) ;
50
52
@@ -76,6 +78,16 @@ async function setup({ failOnUrl }: { failOnUrl?: string } = {}) {
76
78
} ;
77
79
} ) ;
78
80
81
+ getNodeVersionDownloadInfo . mockImplementation ( ( version , architecture , isWindows , repoRoot ) => {
82
+ return {
83
+ url : `https://mirrors.nodejs.org/dist/v${ version } /node-v${ version } -${ architecture } .tar.gz` ,
84
+ downloadName : `node-v${ version } -${ architecture } .tar.gz` ,
85
+ downloadPath : `/mocked/path/.node_binaries/${ version } /node-v${ version } -${ architecture } .tar.gz` ,
86
+ extractDir : `/mocked/path/.node_binaries/${ version } /${ architecture } ` ,
87
+ version,
88
+ } ;
89
+ } ) ;
90
+
79
91
getNodeShasums . mockReturnValue ( {
80
92
'linux:downloadName' : 'linux:sha256' ,
81
93
'darwin:downloadName' : 'darwin:sha256' ,
@@ -134,6 +146,42 @@ it('downloads node builds for each platform', async () => {
134
146
"url": "win32:url",
135
147
},
136
148
],
149
+ Array [
150
+ Object {
151
+ "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-linux-x64.tar.gz",
152
+ "log": <ToolingLog>,
153
+ "retries": 3,
154
+ "sha256": undefined,
155
+ "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-linux-x64.tar.gz",
156
+ },
157
+ ],
158
+ Array [
159
+ Object {
160
+ "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-linux-arm64.tar.gz",
161
+ "log": <ToolingLog>,
162
+ "retries": 3,
163
+ "sha256": undefined,
164
+ "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-linux-arm64.tar.gz",
165
+ },
166
+ ],
167
+ Array [
168
+ Object {
169
+ "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-darwin-x64.tar.gz",
170
+ "log": <ToolingLog>,
171
+ "retries": 3,
172
+ "sha256": undefined,
173
+ "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-darwin-x64.tar.gz",
174
+ },
175
+ ],
176
+ Array [
177
+ Object {
178
+ "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-win32-x64.tar.gz",
179
+ "log": <ToolingLog>,
180
+ "retries": 3,
181
+ "sha256": undefined,
182
+ "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-win32-x64.tar.gz",
183
+ },
184
+ ],
137
185
]
138
186
` ) ;
139
187
expect ( testWriter . messages ) . toMatchInlineSnapshot ( `Array []` ) ;
0 commit comments