@@ -3171,7 +3171,7 @@ t.test('installLinks', (t) => {
3171
3171
t . end ( )
3172
3172
} )
3173
3173
3174
- t . only ( 'should preserve exact ranges, missing actual tree' , async ( t ) => {
3174
+ t . test ( 'should preserve exact ranges, missing actual tree' , async ( t ) => {
3175
3175
const Pacote = require ( 'pacote' )
3176
3176
const Arborist = t . mock ( '../../lib/arborist' , {
3177
3177
pacote : {
@@ -3256,7 +3256,7 @@ t.only('should preserve exact ranges, missing actual tree', async (t) => {
3256
3256
} ,
3257
3257
} )
3258
3258
3259
- t . only ( 'host should not be replaced replaceRegistryHost=never' , async ( t ) => {
3259
+ t . test ( 'host should not be replaced replaceRegistryHost=never' , async ( t ) => {
3260
3260
const testdir = t . testdir ( {
3261
3261
project : {
3262
3262
'package.json' : JSON . stringify ( {
@@ -3296,7 +3296,7 @@ t.only('should preserve exact ranges, missing actual tree', async (t) => {
3296
3296
await arb . reify ( )
3297
3297
} )
3298
3298
3299
- t . only ( 'host should be replaced replaceRegistryHost=npmjs' , async ( t ) => {
3299
+ t . test ( 'host should be replaced replaceRegistryHost=npmjs' , async ( t ) => {
3300
3300
const testdir = t . testdir ( {
3301
3301
project : {
3302
3302
'package.json' : JSON . stringify ( {
@@ -3336,7 +3336,7 @@ t.only('should preserve exact ranges, missing actual tree', async (t) => {
3336
3336
await arb . reify ( )
3337
3337
} )
3338
3338
3339
- t . only ( 'host should be always replaceRegistryHost=always' , async ( t ) => {
3339
+ t . test ( 'host should be always replaceRegistryHost=always' , async ( t ) => {
3340
3340
const testdir = t . testdir ( {
3341
3341
project : {
3342
3342
'package.json' : JSON . stringify ( {
@@ -3375,6 +3375,52 @@ t.only('should preserve exact ranges, missing actual tree', async (t) => {
3375
3375
} )
3376
3376
await arb . reify ( )
3377
3377
} )
3378
+
3379
+ t . test ( 'registry with path should only swap hostname' , async ( t ) => {
3380
+ const abbrevPackument3 = JSON . stringify ( {
3381
+ _id : 'abbrev' ,
3382
+ _rev : 'lkjadflkjasdf' ,
3383
+ name : 'abbrev' ,
3384
+ 'dist-tags' : { latest : '1.1.1' } ,
3385
+ versions : {
3386
+ '1.1.1' : {
3387
+ name : 'abbrev' ,
3388
+ version : '1.1.1' ,
3389
+ dist : {
3390
+ tarball : 'https://artifactory.example.com/api/npm/npm-all/abbrev/-/abbrev-1.1.1.tgz' ,
3391
+ } ,
3392
+ } ,
3393
+ } ,
3394
+ } )
3395
+
3396
+ const testdir = t . testdir ( {
3397
+ project : {
3398
+ 'package.json' : JSON . stringify ( {
3399
+ name : 'myproject' ,
3400
+ version : '1.0.0' ,
3401
+ dependencies : {
3402
+ abbrev : '1.1.1' ,
3403
+ } ,
3404
+ } ) ,
3405
+ } ,
3406
+ } )
3407
+
3408
+ tnock ( t , 'https://new-host.artifactory.example.com' )
3409
+ . get ( '/api/npm/npm-all/abbrev' )
3410
+ . reply ( 200 , abbrevPackument3 )
3411
+
3412
+ tnock ( t , 'https://new-host.artifactory.example.com' )
3413
+ . get ( '/api/npm/npm-all/abbrev/-/abbrev-1.1.1.tgz' )
3414
+ . reply ( 200 , abbrevTGZ )
3415
+
3416
+ const arb = new Arborist ( {
3417
+ path : resolve ( testdir , 'project' ) ,
3418
+ registry : 'https://new-host.artifactory.example.com/api/npm/npm-all' ,
3419
+ cache : resolve ( testdir , 'cache' ) ,
3420
+ replaceRegistryHost : 'always' ,
3421
+ } )
3422
+ await arb . reify ( )
3423
+ } )
3378
3424
} )
3379
3425
3380
3426
t . test ( 'install stategy linked' , async ( t ) => {
0 commit comments