@@ -57,7 +57,7 @@ t.test('edit', async t => {
57
57
const { npm } = await loadMockNpm ( t )
58
58
await t . rejects (
59
59
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 / ,
61
61
'should throw not implemented yet error'
62
62
)
63
63
} )
@@ -79,7 +79,7 @@ t.test('access public on unscoped package', async t => {
79
79
80
80
t . test ( 'access public on scoped package' , async t => {
81
81
const name = '@scoped/npm-access-public-pkg'
82
- const { npm, joinedOutput } = await loadMockNpm ( t , {
82
+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
83
83
config : {
84
84
...auth ,
85
85
} ,
@@ -94,6 +94,7 @@ t.test('access public on scoped package', async t => {
94
94
} )
95
95
registry . access ( { spec : name , access : 'public' } )
96
96
await npm . exec ( 'access' , [ 'public' ] )
97
+ t . match ( logs . warn [ 0 ] , [ 'access' , 'public subcommand will be removed in the next version of npm' ] )
97
98
t . equal ( joinedOutput ( ) , '' )
98
99
} )
99
100
@@ -137,7 +138,7 @@ t.test('access restricted on unscoped package', async t => {
137
138
138
139
t . test ( 'access restricted on scoped package' , async t => {
139
140
const name = '@scoped/npm-access-restricted-pkg'
140
- const { npm, joinedOutput } = await loadMockNpm ( t , {
141
+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
141
142
config : {
142
143
...auth ,
143
144
} ,
@@ -152,6 +153,9 @@ t.test('access restricted on scoped package', async t => {
152
153
} )
153
154
registry . access ( { spec : name , access : 'restricted' } )
154
155
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
+ )
155
159
t . equal ( joinedOutput ( ) , '' )
156
160
} )
157
161
@@ -274,7 +278,7 @@ t.test('access grant malformed team arg', async t => {
274
278
} )
275
279
276
280
t . test ( 'access 2fa-required' , async t => {
277
- const { npm, joinedOutput } = await loadMockNpm ( t , {
281
+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
278
282
config : {
279
283
...auth ,
280
284
} ,
@@ -286,11 +290,14 @@ t.test('access 2fa-required', async t => {
286
290
} )
287
291
registry . access ( { spec : '@scope/pkg' , publishRequires2fa : true } )
288
292
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
+ )
289
296
t . equal ( joinedOutput ( ) , '' )
290
297
} )
291
298
292
299
t . test ( 'access 2fa-not-required' , async t => {
293
- const { npm, joinedOutput } = await loadMockNpm ( t , {
300
+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
294
301
config : {
295
302
...auth ,
296
303
} ,
@@ -302,6 +309,9 @@ t.test('access 2fa-not-required', async t => {
302
309
} )
303
310
registry . access ( { spec : '@scope/pkg' , publishRequires2fa : false } )
304
311
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
+ )
305
315
t . equal ( joinedOutput ( ) , '' )
306
316
} )
307
317
@@ -348,7 +358,7 @@ t.test('access revoke malformed team arg', async t => {
348
358
} )
349
359
350
360
t . 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 , {
352
362
config : {
353
363
...auth ,
354
364
} ,
@@ -363,6 +373,9 @@ t.test('npm access ls-packages with no team', async t => {
363
373
registry . whoami ( { username : team } )
364
374
registry . lsPackages ( { team, packages } )
365
375
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
+ )
366
379
t . match ( JSON . parse ( joinedOutput ( ) ) , packages )
367
380
} )
368
381
@@ -385,7 +398,7 @@ t.test('access ls-packages on team', async t => {
385
398
} )
386
399
387
400
t . test ( 'access ls-collaborators on current' , async t => {
388
- const { npm, joinedOutput } = await loadMockNpm ( t , {
401
+ const { npm, joinedOutput, logs } = await loadMockNpm ( t , {
389
402
config : {
390
403
...auth ,
391
404
} ,
@@ -403,6 +416,9 @@ t.test('access ls-collaborators on current', async t => {
403
416
const collaborators = { 'test-user' : 'read-write' }
404
417
registry . lsCollaborators ( { spec : 'yargs' , collaborators } )
405
418
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
+ )
406
422
t . match ( JSON . parse ( joinedOutput ( ) ) , collaborators )
407
423
} )
408
424
0 commit comments