@@ -83,6 +83,13 @@ describe('core/auth/emulator', () => {
8383 expect ( emulatorEndpoint . calls . length ) . to . eq ( 1 ) ;
8484 } ) ;
8585
86+ it ( 'updates the endpoint appropriately with trailing slash' , async ( ) => {
87+ useAuthEmulator ( auth , 'http://localhost:2020/' ) ;
88+ await user . delete ( ) ;
89+ expect ( normalEndpoint . calls . length ) . to . eq ( 0 ) ;
90+ expect ( emulatorEndpoint . calls . length ) . to . eq ( 1 ) ;
91+ } ) ;
92+
8693 it ( 'checks the scheme properly' , ( ) => {
8794 expect ( ( ) => useAuthEmulator ( auth , 'http://localhost:2020' ) ) . not . to . throw ;
8895 delete auth . config . emulator ;
@@ -134,6 +141,36 @@ describe('core/auth/emulator', () => {
134141 expect ( document . querySelector ( '.firebase-emulator-warning' ) ) . to . be . null ;
135142 }
136143 } ) ;
144+
145+ it ( 'sets emulatorConfig on the Auth object' , async ( ) => {
146+ useAuthEmulator ( auth , 'http://localhost:2020' ) ;
147+ expect ( auth . emulatorConfig ) . to . eql ( {
148+ protocol : 'http' ,
149+ host : 'localhost' ,
150+ port : 2020 ,
151+ options : { disableWarnings : false }
152+ } ) ;
153+ } ) ;
154+
155+ it ( 'sets disableWarnings in emulatorConfig accordingly' , async ( ) => {
156+ useAuthEmulator ( auth , 'https://127.0.0.1' , { disableWarnings : true } ) ;
157+ expect ( auth . emulatorConfig ) . to . eql ( {
158+ protocol : 'https' ,
159+ host : '127.0.0.1' ,
160+ port : null ,
161+ options : { disableWarnings : true }
162+ } ) ;
163+ } ) ;
164+
165+ it ( 'quotes IPv6 address in emulatorConfig' , async ( ) => {
166+ useAuthEmulator ( auth , 'http://[::1]:2020/' ) ;
167+ expect ( auth . emulatorConfig ) . to . eql ( {
168+ protocol : 'http' ,
169+ host : '[::1]' ,
170+ port : 2020 ,
171+ options : { disableWarnings : false }
172+ } ) ;
173+ } ) ;
137174 } ) ;
138175
139176 context ( 'toJSON' , ( ) => {
0 commit comments