@@ -46,6 +46,12 @@ function mocks (server) {
46
46
server . delete ( '/-/package/@scoped%2fanother/dist-tags/c' )
47
47
. reply ( 200 , { c : '7.7.7' } )
48
48
49
+ // using a scoped registry
50
+ server . get ( '/-/package/@scoped%2ffoo/dist-tags' )
51
+ . reply ( 200 , { latest : '2.0.0' , a : '0.0.2' , b : '0.6.0' } )
52
+ server . delete ( '/-/package/@scoped%2ffoo/dist-tags/b' )
53
+ . reply ( 200 , { b : '0.6.0' } )
54
+
49
55
// rm
50
56
server . get ( '/-/package/@scoped%2fanother/dist-tags' )
51
57
. reply ( 200 , { latest : '4.0.0' } )
@@ -232,6 +238,31 @@ test('npm dist-tags rm @scoped/another nonexistent', function (t) {
232
238
)
233
239
} )
234
240
241
+ test ( 'npm dist-tags rm with registry assigned to scope' , function ( t ) {
242
+ fs . writeFileSync ( path . resolve ( pkg , '.npmrc' ) , `
243
+ @scoped:registry=${ common . registry }
244
+ ${ common . registry . replace ( / ^ h t t p s ? : / , '' ) } :_authToken=taken
245
+ ` )
246
+
247
+ common . npm (
248
+ [
249
+ 'dist-tags' ,
250
+ 'rm' , '@scoped/foo' , 'b' ,
251
+ '--loglevel' , 'silent' ,
252
+ '--userconfig' , path . resolve ( pkg , '.npmrc' )
253
+ ] ,
254
+ { cwd : pkg } ,
255
+ function ( er , code , stdout , stderr ) {
256
+ t . ifError ( er , 'npm access' )
257
+ t . notOk ( code , 'exited OK' )
258
+ t . notOk ( stderr , 'no error output' )
259
+ t . equal ( stdout , '-b: @scoped/[email protected] \n' )
260
+
261
+ t . end ( )
262
+ }
263
+ )
264
+ } )
265
+
235
266
test ( 'cleanup' , function ( t ) {
236
267
t . pass ( 'cleaned up' )
237
268
rimraf . sync ( pkg )
0 commit comments