@@ -57,7 +57,7 @@ t.test('edit', async t => {
5757 const { npm } = await loadMockNpm ( t )
5858 await t . rejects (
5959 npm . exec ( 'access' , [ 'edit' , '@scoped/another' ] ) ,
60- / e d i t s u b c o m m a n d i s n o t i m p l e m e n t e d y e t / ,
60+ / e d i t s u b c o m m a n d i s n o t i m p l e m e n t e d / ,
6161 'should throw not implemented yet error'
6262 )
6363} )
@@ -79,7 +79,7 @@ t.test('access public on unscoped package', async t => {
7979
8080t . test ( 'access public on scoped package' , async t => {
8181 const name = '@scoped/npm-access-public-pkg'
82- const { npm, joinedOutput } = await loadMockNpm ( t , {
82+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
8383 config : {
8484 ...auth ,
8585 } ,
@@ -94,6 +94,7 @@ t.test('access public on scoped package', async t => {
9494 } )
9595 registry . access ( { spec : name , access : 'public' } )
9696 await npm . exec ( 'access' , [ 'public' ] )
97+ t . match ( logs . warn [ 0 ] , [ 'access' , 'public subcommand will be removed in the next version of npm' ] )
9798 t . equal ( joinedOutput ( ) , '' )
9899} )
99100
@@ -137,7 +138,7 @@ t.test('access restricted on unscoped package', async t => {
137138
138139t . test ( 'access restricted on scoped package' , async t => {
139140 const name = '@scoped/npm-access-restricted-pkg'
140- const { npm, joinedOutput } = await loadMockNpm ( t , {
141+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
141142 config : {
142143 ...auth ,
143144 } ,
@@ -152,6 +153,9 @@ t.test('access restricted on scoped package', async t => {
152153 } )
153154 registry . access ( { spec : name , access : 'restricted' } )
154155 await npm . exec ( 'access' , [ 'restricted' ] )
156+ t . match ( logs . warn [ 0 ] ,
157+ [ 'access' , 'restricted subcommand will be removed in the next version of npm' ]
158+ )
155159 t . equal ( joinedOutput ( ) , '' )
156160} )
157161
@@ -274,7 +278,7 @@ t.test('access grant malformed team arg', async t => {
274278} )
275279
276280t . test ( 'access 2fa-required' , async t => {
277- const { npm, joinedOutput } = await loadMockNpm ( t , {
281+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
278282 config : {
279283 ...auth ,
280284 } ,
@@ -286,11 +290,14 @@ t.test('access 2fa-required', async t => {
286290 } )
287291 registry . access ( { spec : '@scope/pkg' , publishRequires2fa : true } )
288292 await npm . exec ( 'access' , [ '2fa-required' , '@scope/pkg' ] )
293+ t . match ( logs . warn [ 0 ] ,
294+ [ 'access' , '2fa-required subcommand will be removed in the next version of npm' ]
295+ )
289296 t . equal ( joinedOutput ( ) , '' )
290297} )
291298
292299t . test ( 'access 2fa-not-required' , async t => {
293- const { npm, joinedOutput } = await loadMockNpm ( t , {
300+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
294301 config : {
295302 ...auth ,
296303 } ,
@@ -302,6 +309,9 @@ t.test('access 2fa-not-required', async t => {
302309 } )
303310 registry . access ( { spec : '@scope/pkg' , publishRequires2fa : false } )
304311 await npm . exec ( 'access' , [ '2fa-not-required' , '@scope/pkg' ] )
312+ t . match ( logs . warn [ 0 ] ,
313+ [ 'access' , '2fa-not-required subcommand will be removed in the next version of npm' ]
314+ )
305315 t . equal ( joinedOutput ( ) , '' )
306316} )
307317
@@ -348,7 +358,7 @@ t.test('access revoke malformed team arg', async t => {
348358} )
349359
350360t . test ( 'npm access ls-packages with no team' , async t => {
351- const { npm, joinedOutput } = await loadMockNpm ( t , {
361+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
352362 config : {
353363 ...auth ,
354364 } ,
@@ -363,6 +373,9 @@ t.test('npm access ls-packages with no team', async t => {
363373 registry . whoami ( { username : team } )
364374 registry . lsPackages ( { team, packages } )
365375 await npm . exec ( 'access' , [ 'ls-packages' ] )
376+ t . match ( logs . warn [ 0 ] ,
377+ [ 'access' , 'ls-packages subcommand will be removed in the next version of npm' ]
378+ )
366379 t . match ( JSON . parse ( joinedOutput ( ) ) , packages )
367380} )
368381
@@ -385,7 +398,7 @@ t.test('access ls-packages on team', async t => {
385398} )
386399
387400t . test ( 'access ls-collaborators on current' , async t => {
388- const { npm, joinedOutput } = await loadMockNpm ( t , {
401+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
389402 config : {
390403 ...auth ,
391404 } ,
@@ -403,6 +416,9 @@ t.test('access ls-collaborators on current', async t => {
403416 const collaborators = { 'test-user' : 'read-write' }
404417 registry . lsCollaborators ( { spec : 'yargs' , collaborators } )
405418 await npm . exec ( 'access' , [ 'ls-collaborators' ] )
419+ t . match ( logs . warn [ 0 ] ,
420+ [ 'access' , 'ls-collaborators subcommand will be removed in the next version of npm' ]
421+ )
406422 t . match ( JSON . parse ( joinedOutput ( ) ) , collaborators )
407423} )
408424
0 commit comments