File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ describe('Auth', function () {
4242 const bar = auth ( ) . useEmulator ( 'http://127.0.0.1:9099' ) ;
4343 expect ( bar ) . toEqual ( [ '10.0.2.2' , 9099 ] ) ;
4444 } ) ;
45+
46+ it ( 'useEmulator allows hyphens in the hostname' , function ( ) {
47+ const result = auth ( ) . useEmulator ( 'http://my-host:9099' ) ;
48+ expect ( result ) . toEqual ( [ 'my-host' , 9099 ] ) ;
49+ } ) ;
4550 } ) ;
4651
4752 describe ( 'tenantId' , function ( ) {
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ class FirebaseAuthModule extends FirebaseModule {
381381 }
382382
383383 // Native calls take the host and port split out
384- const hostPortRegex = / ^ h t t p : \/ \/ ( [ \w \d . ] + ) : ( \d + ) $ / ;
384+ const hostPortRegex = / ^ h t t p : \/ \/ ( [ \w \d - . ] + ) : ( \d + ) $ / ;
385385 const urlMatches = _url . match ( hostPortRegex ) ;
386386 if ( ! urlMatches ) {
387387 throw new Error ( 'firebase.auth().useEmulator() unable to parse host and port from URL' ) ;
You can’t perform that action at this time.
0 commit comments