File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const log = require('npmlog')
44const npm = require ( './npm.js' )
55const output = require ( './utils/output.js' )
66const usageUtil = require ( './utils/usage.js' )
7+ const replaceInfo = require ( './utils/replace-info.js' )
78const authTypes = {
89 legacy : require ( './auth/legacy.js' ) ,
910 oauth : require ( './auth/oauth.js' ) ,
@@ -57,6 +58,8 @@ const adduser = async (args) => {
5758
5859 log . disableProgress ( )
5960
61+ log . notice ( '' , `Log in on ${ replaceInfo ( registry ) } ` )
62+
6063 const { message, newCreds } = await auth ( {
6164 creds,
6265 registry,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const _flatOptions = {
1313
1414let failSave = false
1515let deletedConfig = { }
16+ let registryOutput = ''
1617let setConfig = { }
1718const authDummy = ( ) => Promise . resolve ( {
1819 message : 'success' ,
@@ -32,7 +33,10 @@ const deleteMock = (key, where) => {
3233}
3334const adduser = requireInject ( '../../lib/adduser.js' , {
3435 npmlog : {
35- disableProgress : ( ) => null
36+ disableProgress : ( ) => null ,
37+ notice : ( _ , msg ) => {
38+ registryOutput = msg
39+ } ,
3640 } ,
3741 '../../lib/npm.js' : {
3842 flatOptions : _flatOptions ,
@@ -69,6 +73,12 @@ test('simple login', (t) => {
6973 adduser ( [ ] , ( err ) => {
7074 t . ifError ( err , 'npm adduser' )
7175
76+ t . equal (
77+ registryOutput ,
78+ 'Log in on https://registry.npmjs.org/' ,
79+ 'should have correct message result'
80+ )
81+
7282 t . deepEqual (
7383 deletedConfig ,
7484 {
@@ -102,6 +112,7 @@ test('simple login', (t) => {
102112 'should output auth success msg'
103113 )
104114
115+ registryOutput = ''
105116 deletedConfig = { }
106117 setConfig = { }
107118 result = ''
You can’t perform that action at this time.
0 commit comments