@@ -46,7 +46,7 @@ function registryPackage (t, registry, name) {
46
46
name,
47
47
packuments : [ { maintainers, version : '1.0.0' } ] ,
48
48
} )
49
- mockRegistry . package ( { manifest } )
49
+ return mockRegistry . package ( { manifest } )
50
50
}
51
51
52
52
t . test ( 'owner no args' , async t => {
@@ -73,7 +73,7 @@ t.test('owner ls no args', async t => {
73
73
name : packageName ,
74
74
packuments : [ { maintainers, version : '1.0.0' } ] ,
75
75
} )
76
- registry . package ( { manifest } )
76
+ await registry . package ( { manifest } )
77
77
78
78
await npm . exec ( 'owner' , [ 'ls' ] )
79
79
t . match ( joinedOutput ( ) , maintainers . map ( m => `${ m . name } <${ m . email } >` ) . join ( '\n' ) )
@@ -137,7 +137,7 @@ t.test('owner ls <pkg>', async t => {
137
137
name : packageName ,
138
138
packuments : [ { maintainers, version : '1.0.0' } ] ,
139
139
} )
140
- registry . package ( { manifest } )
140
+ await registry . package ( { manifest } )
141
141
142
142
await npm . exec ( 'owner' , [ 'ls' , packageName ] )
143
143
t . match ( joinedOutput ( ) , maintainers . map ( m => `${ m . name } <${ m . email } >` ) . join ( '\n' ) )
@@ -153,7 +153,7 @@ t.test('owner ls <pkg> no maintainers', async t => {
153
153
name : packageName ,
154
154
versions : [ '1.0.0' ] ,
155
155
} )
156
- registry . package ( { manifest } )
156
+ await registry . package ( { manifest } )
157
157
158
158
await npm . exec ( 'owner' , [ 'ls' , packageName ] )
159
159
t . equal ( joinedOutput ( ) , 'no admin found' )
@@ -173,7 +173,7 @@ t.test('owner add <user> <pkg>', async t => {
173
173
packuments : [ { maintainers, version : '1.0.0' } ] ,
174
174
} )
175
175
registry . couchuser ( { username } )
176
- registry . package ( { manifest } )
176
+ await registry . package ( { manifest } )
177
177
registry . nock . put ( `/${ spec . escapedName } /-rev/${ manifest . _rev } ` , body => {
178
178
t . match ( body , {
179
179
_id : manifest . _id ,
@@ -206,7 +206,7 @@ t.test('owner add <user> cwd package', async t => {
206
206
packuments : [ { maintainers, version : '1.0.0' } ] ,
207
207
} )
208
208
registry . couchuser ( { username } )
209
- registry . package ( { manifest } )
209
+ await registry . package ( { manifest } )
210
210
registry . nock . put ( `/${ spec . escapedName } /-rev/${ manifest . _rev } ` , body => {
211
211
t . match ( body , {
212
212
_id : manifest . _id ,
@@ -236,7 +236,7 @@ t.test('owner add <user> <pkg> already an owner', async t => {
236
236
packuments : [ { maintainers, version : '1.0.0' } ] ,
237
237
} )
238
238
registry . couchuser ( { username } )
239
- registry . package ( { manifest } )
239
+ await registry . package ( { manifest } )
240
240
await npm . exec ( 'owner' , [ 'add' , username , packageName ] )
241
241
t . equal ( joinedOutput ( ) , '' )
242
242
t . match (
@@ -273,7 +273,7 @@ t.test('owner add <user> <pkg> fails to PUT updates', async t => {
273
273
packuments : [ { maintainers, version : '1.0.0' } ] ,
274
274
} )
275
275
registry . couchuser ( { username } )
276
- registry . package ( { manifest } )
276
+ await registry . package ( { manifest } )
277
277
registry . nock . put ( `/${ spec . escapedName } /-rev/${ manifest . _rev } ` ) . reply ( 404 , { } )
278
278
await t . rejects (
279
279
npm . exec ( 'owner' , [ 'add' , username , packageName ] ) ,
@@ -295,7 +295,7 @@ t.test('owner add <user> <pkg> no previous maintainers property from server', as
295
295
packuments : [ { maintainers : undefined , version : '1.0.0' } ] ,
296
296
} )
297
297
registry . couchuser ( { username } )
298
- registry . package ( { manifest } )
298
+ await registry . package ( { manifest } )
299
299
registry . nock . put ( `/${ spec . escapedName } /-rev/${ manifest . _rev } ` , body => {
300
300
t . match ( body , {
301
301
_id : manifest . _id ,
@@ -351,7 +351,7 @@ t.test('owner rm <user> <pkg>', async t => {
351
351
packuments : [ { maintainers, version : '1.0.0' } ] ,
352
352
} )
353
353
registry . couchuser ( { username } )
354
- registry . package ( { manifest } )
354
+ await registry . package ( { manifest } )
355
355
registry . nock . put ( `/${ spec . escapedName } /-rev/${ manifest . _rev } ` , body => {
356
356
t . match ( body , {
357
357
_id : manifest . _id ,
@@ -378,7 +378,7 @@ t.test('owner rm <user> <pkg> not a current owner', async t => {
378
378
packuments : [ { maintainers, version : '1.0.0' } ] ,
379
379
} )
380
380
registry . couchuser ( { username } )
381
- registry . package ( { manifest } )
381
+ await registry . package ( { manifest } )
382
382
await npm . exec ( 'owner' , [ 'rm' , username , packageName ] )
383
383
t . match ( logs . info , [ [ 'owner rm' , `Not a package owner: ${ username } ` ] ] )
384
384
} )
@@ -400,7 +400,7 @@ t.test('owner rm <user> cwd package', async t => {
400
400
packuments : [ { maintainers, version : '1.0.0' } ] ,
401
401
} )
402
402
registry . couchuser ( { username } )
403
- registry . package ( { manifest } )
403
+ await registry . package ( { manifest } )
404
404
registry . nock . put ( `/${ spec . escapedName } /-rev/${ manifest . _rev } ` , body => {
405
405
t . match ( body , {
406
406
_id : manifest . _id ,
@@ -430,7 +430,7 @@ t.test('owner rm <user> only user', async t => {
430
430
packuments : [ { maintainers : maintainers . slice ( 0 , 1 ) , version : '1.0.0' } ] ,
431
431
} )
432
432
registry . couchuser ( { username } )
433
- registry . package ( { manifest } )
433
+ await registry . package ( { manifest } )
434
434
await t . rejects (
435
435
npm . exec ( 'owner' , [ 'rm' , username ] ) ,
436
436
{
@@ -486,7 +486,7 @@ t.test('workspaces', async t => {
486
486
'process.cwd' : ( ) => path . join ( prefix , 'workspace-a' ) ,
487
487
} ) ,
488
488
} )
489
- registryPackage ( t , npm . config . get ( 'registry' ) , 'workspace-a' )
489
+ await registryPackage ( t , npm . config . get ( 'registry' ) , 'workspace-a' )
490
490
await npm . exec ( 'owner' , [ 'ls' ] )
491
491
t . match ( joinedOutput ( ) , maintainers . map ( m => `${ m . name } <${ m . email } >` ) . join ( '\n' ) )
492
492
} )
@@ -499,7 +499,7 @@ t.test('workspaces', async t => {
499
499
} ) ,
500
500
} )
501
501
npm . config . set ( 'workspace' , [ 'workspace-a' ] )
502
- registryPackage ( t , npm . config . get ( 'registry' ) , 'workspace-a' )
502
+ await registryPackage ( t , npm . config . get ( 'registry' ) , 'workspace-a' )
503
503
await npm . exec ( 'owner' , [ 'ls' ] )
504
504
t . match ( joinedOutput ( ) , maintainers . map ( m => `${ m . name } <${ m . email } >` ) . join ( '\n' ) )
505
505
} )
@@ -511,7 +511,7 @@ t.test('workspaces', async t => {
511
511
'process.cwd' : ( ) => path . join ( prefix , 'workspace-a' ) ,
512
512
} ) ,
513
513
} )
514
- registryPackage ( t , npm . config . get ( 'registry' ) , packageName )
514
+ await registryPackage ( t , npm . config . get ( 'registry' ) , packageName )
515
515
await npm . exec ( 'owner' , [ 'ls' , packageName ] )
516
516
t . match ( joinedOutput ( ) , maintainers . map ( m => `${ m . name } <${ m . email } >` ) . join ( '\n' ) )
517
517
} )
@@ -524,7 +524,7 @@ t.test('workspaces', async t => {
524
524
} ) ,
525
525
} )
526
526
npm . config . set ( 'workspace' , [ 'workspace-a' ] )
527
- registryPackage ( t , npm . config . get ( 'registry' ) , packageName )
527
+ await registryPackage ( t , npm . config . get ( 'registry' ) , packageName )
528
528
await npm . exec ( 'owner' , [ 'ls' , packageName ] )
529
529
t . match ( joinedOutput ( ) , maintainers . map ( m => `${ m . name } <${ m . email } >` ) . join ( '\n' ) )
530
530
} )
@@ -543,7 +543,7 @@ t.test('workspaces', async t => {
543
543
name : 'workspace-a' ,
544
544
packuments : [ { maintainers, version : '1.0.0' } ] ,
545
545
} )
546
- registry . package ( { manifest } )
546
+ await registry . package ( { manifest } )
547
547
registry . couchuser ( { username } )
548
548
registry . nock . put ( `/workspace-a/-rev/${ manifest . _rev } ` , body => {
549
549
t . match ( body , {
@@ -572,7 +572,7 @@ t.test('workspaces', async t => {
572
572
name : 'workspace-a' ,
573
573
packuments : [ { maintainers, version : '1.0.0' } ] ,
574
574
} )
575
- registry . package ( { manifest } )
575
+ await registry . package ( { manifest } )
576
576
registry . couchuser ( { username } )
577
577
registry . nock . put ( `/workspace-a/-rev/${ manifest . _rev } ` , body => {
578
578
t . match ( body , {
@@ -603,7 +603,7 @@ t.test('workspaces', async t => {
603
603
name : 'workspace-a' ,
604
604
packuments : [ { maintainers, version : '1.0.0' } ] ,
605
605
} )
606
- registry . package ( { manifest } )
606
+ await registry . package ( { manifest } )
607
607
registry . couchuser ( { username } )
608
608
registry . nock . put ( `/workspace-a/-rev/${ manifest . _rev } ` , body => {
609
609
t . match ( body , {
@@ -649,7 +649,7 @@ t.test('completion', async t => {
649
649
name : packageName ,
650
650
packuments : [ { maintainers, version : '1.0.0' } ] ,
651
651
} )
652
- registry . package ( { manifest } )
652
+ await registry . package ( { manifest } )
653
653
const res = await owner . completion ( { conf : { argv : { remain : [ 'npm' , 'owner' , 'rm' ] } } } )
654
654
t . strictSame ( res , maintainers . map ( m => m . name ) , 'should return list of current owners' )
655
655
} )
@@ -683,7 +683,7 @@ t.test('completion', async t => {
683
683
name : packageName ,
684
684
packuments : [ { maintainers : [ ] , version : '1.0.0' } ] ,
685
685
} )
686
- registry . package ( { manifest } )
686
+ await registry . package ( { manifest } )
687
687
688
688
const res = await owner . completion ( { conf : { argv : { remain : [ 'npm' , 'owner' , 'rm' ] } } } )
689
689
t . strictSame ( res , [ ] , 'should return no owners if not found' )
0 commit comments