@@ -71,10 +71,16 @@ t.test('grant', t => {
7171 } )
7272
7373 t . test ( 'read-only' , async t => {
74- const { npm } = await loadMockNpm ( t )
74+ const authToken = 'abcd1234'
75+ const { npm } = await loadMockNpm ( t , {
76+ config : {
77+ '//registry.npmjs.org/:_authToken' : authToken ,
78+ } ,
79+ } )
7580 const registry = new MockRegistry ( {
7681 tap : t ,
7782 registry : npm . config . get ( 'registry' ) ,
83+ authorization : authToken ,
7884 } )
7985 const permissions = 'read-only'
8086 registry . setPermissions ( { spec : '@npmcli/test-package' , team : '@npm:test-team' , permissions } )
@@ -85,10 +91,16 @@ t.test('grant', t => {
8591
8692t . test ( 'revoke' , t => {
8793 t . test ( 'success' , async t => {
88- const { npm } = await loadMockNpm ( t )
94+ const authToken = 'abcd1234'
95+ const { npm } = await loadMockNpm ( t , {
96+ config : {
97+ '//registry.npmjs.org/:_authToken' : authToken ,
98+ } ,
99+ } )
89100 const registry = new MockRegistry ( {
90101 tap : t ,
91102 registry : npm . config . get ( 'registry' ) ,
103+ authorization : authToken ,
92104 } )
93105 registry . removePermissions ( { spec : '@npmcli/test-package' , team : '@npm:test-team' } )
94106 await npm . exec ( 'access' , [ 'revoke' , '@npm:test-team' , '@npmcli/test-package' ] )
0 commit comments