@@ -136,6 +136,44 @@ t.test('npm init @scope/name', async t => {
136136 await init . exec ( [ '@npmcli/something' ] )
137137} )
138138
139+ t . test ( 'npm init @scope@spec' , async t => {
140+ t . plan ( 1 )
141+ npm . localPrefix = t . testdir ( { } )
142+
143+ const Init = t . mock ( '../../../lib/commands/init.js' , {
144+ libnpmexec : ( { args } ) => {
145+ t . same (
146+ args ,
147+ [ '@npmcli/create@foo' ] ,
148+ 'should npx with scoped packages'
149+ )
150+ } ,
151+ } )
152+ const init = new Init ( npm )
153+
154+ process . chdir ( npm . localPrefix )
155+ await init . exec ( [ '@npmcli@foo' ] )
156+ } )
157+
158+ t . test ( 'npm init @scope/name@spec' , async t => {
159+ t . plan ( 1 )
160+ npm . localPrefix = t . testdir ( { } )
161+
162+ const Init = t . mock ( '../../../lib/commands/init.js' , {
163+ libnpmexec : ( { args } ) => {
164+ t . same (
165+ args ,
166+ [ '@npmcli/create-something@foo' ] ,
167+ 'should npx with scoped packages'
168+ )
169+ } ,
170+ } )
171+ const init = new Init ( npm )
172+
173+ process . chdir ( npm . localPrefix )
174+ await init . exec ( [ '@npmcli/something@foo' ] )
175+ } )
176+
139177t . test ( 'npm init git spec' , async t => {
140178 t . plan ( 1 )
141179 npm . localPrefix = t . testdir ( { } )
0 commit comments