@@ -29,30 +29,36 @@ describe('auth tests', () => {
2929 } , 100000 ) ;
3030
3131 it ( 'creates settings.xml with username and password' , async ( ) => {
32+ const id = 'packages' ;
3233 const username = 'bluebottle' ;
3334 const password = 'SingleOrigin' ;
3435
35- await auth . configAuthentication ( username , password ) ;
36+ await auth . configAuthentication ( id , username , password ) ;
3637
3738 expect ( fs . existsSync ( m2Dir ) ) . toBe ( true ) ;
3839 expect ( fs . existsSync ( settingsFile ) ) . toBe ( true ) ;
3940 expect ( fs . readFileSync ( settingsFile , 'utf-8' ) ) . toEqual (
40- auth . generate ( username , password )
41+ auth . generate ( id , username , password )
4142 ) ;
4243 } , 100000 ) ;
4344
4445 it ( 'does not create settings.xml without username and / or password' , async ( ) => {
45- await auth . configAuthentication ( 'FOO' , '' ) ;
46+ await auth . configAuthentication ( 'FOO' , '' , '' ) ;
4647
4748 expect ( fs . existsSync ( m2Dir ) ) . toBe ( false ) ;
4849 expect ( fs . existsSync ( settingsFile ) ) . toBe ( false ) ;
4950
50- await auth . configAuthentication ( '' , 'BAR' ) ;
51+ await auth . configAuthentication ( '' , 'BAR' , '' ) ;
5152
5253 expect ( fs . existsSync ( m2Dir ) ) . toBe ( false ) ;
5354 expect ( fs . existsSync ( settingsFile ) ) . toBe ( false ) ;
5455
55- await auth . configAuthentication ( '' , '' ) ; // BAZ!!!
56+ await auth . configAuthentication ( '' , '' , 'BAZ' ) ;
57+
58+ expect ( fs . existsSync ( m2Dir ) ) . toBe ( false ) ;
59+ expect ( fs . existsSync ( settingsFile ) ) . toBe ( false ) ;
60+
61+ await auth . configAuthentication ( '' , '' , '' ) ;
5662
5763 expect ( fs . existsSync ( m2Dir ) ) . toBe ( false ) ;
5864 expect ( fs . existsSync ( settingsFile ) ) . toBe ( false ) ;
0 commit comments