@@ -46,6 +46,12 @@ function mocks (server) {
4646 server . delete ( '/-/package/@scoped%2fanother/dist-tags/c' )
4747 . reply ( 200 , { c : '7.7.7' } )
4848
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+
4955 // rm
5056 server . get ( '/-/package/@scoped%2fanother/dist-tags' )
5157 . reply ( 200 , { latest : '4.0.0' } )
@@ -232,6 +238,31 @@ test('npm dist-tags rm @scoped/another nonexistent', function (t) {
232238 )
233239} )
234240
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+
235266test ( 'cleanup' , function ( t ) {
236267 t . pass ( 'cleaned up' )
237268 rimraf . sync ( pkg )
0 commit comments