Skip to content

Commit 59ab583

Browse files
committed
Fixed tests
1 parent 25f8be9 commit 59ab583

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/database-compat/test/database.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,12 @@ describe('Database Tests', () => {
294294

295295
it('uses ssl when useEmulator is called with ssl specified', () => {
296296
const db = firebase.database();
297-
db.useEmulator('localhost', 80, { ssl: true });
297+
const cloudWorkstation = 'abc.cloudworkstations.dev';
298+
db.useEmulator(cloudWorkstation, 80);
298299
expect((db as any)._delegate._repo.repoInfo_.isUsingEmulator).to.be.true;
299-
expect((db as any)._delegate._repo.repoInfo_.host).to.equal('localhost:80');
300+
expect((db as any)._delegate._repo.repoInfo_.host).to.equal(
301+
`${cloudWorkstation}:80`
302+
);
300303
expect((db as any)._delegate._repo.repoInfo_.secure).to.be.true;
301304
});
302305

packages/database/src/api/Database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function repoManagerApplyEmulatorSettings(
9191
tokenProvider?: AuthTokenProvider
9292
): void {
9393
const portIndex = hostAndPort.lastIndexOf(':');
94-
const host = hostAndPort.substring(portIndex);
94+
const host = hostAndPort.substring(0, portIndex);
9595
const useSsl = isCloudWorkstation(host);
9696
repo.repoInfo_ = new RepoInfo(
9797
hostAndPort,

0 commit comments

Comments
 (0)