File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/rules-unit-testing/src/api Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -429,7 +429,8 @@ function getHubHost() {
429
429
}
430
430
431
431
function parseHost ( host : string ) : { hostname : string ; port : number } {
432
- const u = new URL ( host ) ;
432
+ const withProtocol = host . startsWith ( "http" ) ? host : `http://${ host } ` ;
433
+ const u = new URL ( withProtocol ) ;
433
434
return {
434
435
hostname : u . hostname ,
435
436
port : Number . parseInt ( u . port , 10 )
@@ -495,6 +496,9 @@ function initializeApp(
495
496
) ;
496
497
}
497
498
if ( databaseName ) {
499
+ const { hostname, port } = parseHost ( getDatabaseHost ( ) ) ;
500
+ app . firestore ( ) . useEmulator ( hostname , port ) ;
501
+
498
502
// Toggle network connectivity to force a reauthentication attempt.
499
503
// This mitigates a minor race condition where the client can send the
500
504
// first database request before authenticating.
You can’t perform that action at this time.
0 commit comments