@@ -3,6 +3,7 @@ const { MockAgent, getGlobalDispatcher, setGlobalDispatcher } = require('urllib'
3
3
const fs = require ( 'fs' ) . promises ;
4
4
const os = require ( 'os' ) ;
5
5
const path = require ( 'path' ) ;
6
+ const pkgJSON = require ( '../package.json' ) ;
6
7
const { MirrorConfig, mirrors } = require ( '..' ) ;
7
8
8
9
const fixtures = path . join ( __dirname , './fixtures' ) ;
@@ -114,6 +115,13 @@ describe('test/index.test.js', () => {
114
115
fs . mkdir ( root , {
115
116
recursive : true ,
116
117
} ) ;
118
+ mockAgent
119
+ . get ( 'https://registry.npmmirror.com' )
120
+ . intercept ( {
121
+ path : '/binary-mirror-config/latest' ,
122
+ method : 'GET' ,
123
+ } )
124
+ . reply ( 200 , pkgJSON ) ;
117
125
} ) ;
118
126
119
127
afterEach ( async ( ) => {
@@ -146,6 +154,7 @@ describe('test/index.test.js', () => {
146
154
assert . deepStrictEqual ( options , {
147
155
env : {
148
156
NODEJS_ORG_MIRROR : 'https://cdn.npmmirror.com/binaries/node' ,
157
+ COREPACK_NPM_REGISTRY : 'https://registry.npmmirror.com' ,
149
158
NVM_NODEJS_ORG_MIRROR : 'https://cdn.npmmirror.com/binaries/node' ,
150
159
PHANTOMJS_CDNURL : 'https://cdn.npmmirror.com/binaries/phantomjs' ,
151
160
CHROMEDRIVER_CDNURL : 'https://cdn.npmmirror.com/binaries/chromedriver' ,
@@ -156,7 +165,8 @@ describe('test/index.test.js', () => {
156
165
SASS_BINARY_SITE : 'https://cdn.npmmirror.com/binaries/node-sass' ,
157
166
SWC_BINARY_SITE : 'https://cdn.npmmirror.com/binaries/node-swc' ,
158
167
NWJS_URLBASE : 'https://cdn.npmmirror.com/binaries/nwjs/v' ,
159
- PUPPETEER_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries' ,
168
+ PUPPETEER_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries/chrome-for-testing' ,
169
+ PUPPETEER_DOWNLOAD_BASE_URL : 'https://cdn.npmmirror.com/binaries/chrome-for-testing' ,
160
170
SENTRYCLI_CDNURL : 'https://cdn.npmmirror.com/binaries/sentry-cli' ,
161
171
SAUCECTL_INSTALL_BINARY_MIRROR : 'https://cdn.npmmirror.com/binaries/saucectl' ,
162
172
PLAYWRIGHT_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries/playwright' ,
@@ -216,6 +226,7 @@ describe('test/index.test.js', () => {
216
226
env : {
217
227
NODEJS_ORG_MIRROR : 'https://cdn.npmmirror.com/binaries/node' ,
218
228
NVM_NODEJS_ORG_MIRROR : 'https://cdn.npmmirror.com/binaries/node' ,
229
+ COREPACK_NPM_REGISTRY : 'https://registry.npmmirror.com' ,
219
230
PHANTOMJS_CDNURL : 'https://cdn.npmmirror.com/binaries/phantomjs' ,
220
231
CHROMEDRIVER_CDNURL : 'https://cdn.npmmirror.com/binaries/chromedriver' ,
221
232
CYPRESS_DOWNLOAD_PATH_TEMPLATE : 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip' ,
@@ -226,7 +237,8 @@ describe('test/index.test.js', () => {
226
237
PLAYWRIGHT_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries/playwright' ,
227
238
SWC_BINARY_SITE : 'https://cdn.npmmirror.com/binaries/node-swc' ,
228
239
NWJS_URLBASE : 'https://cdn.npmmirror.com/binaries/nwjs/v' ,
229
- PUPPETEER_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries' ,
240
+ PUPPETEER_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries/chrome-for-testing' ,
241
+ PUPPETEER_DOWNLOAD_BASE_URL : 'https://cdn.npmmirror.com/binaries/chrome-for-testing' ,
230
242
SENTRYCLI_CDNURL : 'https://cdn.npmmirror.com/binaries/sentry-cli' ,
231
243
SAUCECTL_INSTALL_BINARY_MIRROR : 'https://cdn.npmmirror.com/binaries/saucectl' ,
232
244
RE2_DOWNLOAD_MIRROR : 'https://cdn.npmmirror.com/binaries/node-re2' ,
@@ -289,6 +301,7 @@ describe('test/index.test.js', () => {
289
301
mirrorConfig . setEnvs ( options ) ;
290
302
assert . deepStrictEqual ( options . env , {
291
303
NODEJS_ORG_MIRROR : 'https://cdn.npmmirror.com/binaries/node' ,
304
+ COREPACK_NPM_REGISTRY : 'https://registry.npmmirror.com' ,
292
305
NVM_NODEJS_ORG_MIRROR : 'https://cdn.npmmirror.com/binaries/node' ,
293
306
PHANTOMJS_CDNURL : 'https://cdn.npmmirror.com/binaries/phantomjs' ,
294
307
CHROMEDRIVER_CDNURL : 'https://cdn.npmmirror.com/binaries/chromedriver' ,
@@ -300,7 +313,8 @@ describe('test/index.test.js', () => {
300
313
PLAYWRIGHT_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries/playwright' ,
301
314
SWC_BINARY_SITE : 'https://cdn.npmmirror.com/binaries/node-swc' ,
302
315
NWJS_URLBASE : 'https://cdn.npmmirror.com/binaries/nwjs/v' ,
303
- PUPPETEER_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries' ,
316
+ PUPPETEER_DOWNLOAD_HOST : 'https://cdn.npmmirror.com/binaries/chrome-for-testing' ,
317
+ PUPPETEER_DOWNLOAD_BASE_URL : 'https://cdn.npmmirror.com/binaries/chrome-for-testing' ,
304
318
SENTRYCLI_CDNURL : 'https://cdn.npmmirror.com/binaries/sentry-cli' ,
305
319
SAUCECTL_INSTALL_BINARY_MIRROR : 'https://cdn.npmmirror.com/binaries/saucectl' ,
306
320
RE2_DOWNLOAD_MIRROR : 'https://cdn.npmmirror.com/binaries/node-re2' ,
0 commit comments