Skip to content

Commit 1f65d46

Browse files
Fix spec tests
1 parent 71ed890 commit 1f65d46

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/firestore/test/unit/specs/spec_test_components.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,16 @@ function failTransactionIfNeeded(
121121
}
122122

123123
export class MockOnlineComponentProvider extends OnlineComponentProvider {
124-
connection!: MockConnection;
124+
constructor(private readonly connection: MockConnection) {
125+
super();
126+
}
125127

126128
createDatastore(cfg: ComponentConfiguration): Datastore {
127129
const serializer = new JsonProtoSerializer(
128130
cfg.databaseInfo.databaseId,
129131
/* useProto3Json= */ true
130132
);
131-
return newDatastore(cfg.credentials, new MockConnection(cfg.asyncQueue), serializer);
133+
return newDatastore(cfg.credentials, this.connection, serializer);
132134
}
133135
}
134136

packages/firestore/test/unit/specs/spec_test_runner.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ abstract class TestRunner {
257257
persistenceSettings: this.persistenceSettings
258258
};
259259

260-
const onlineComponentProvider = new MockOnlineComponentProvider();
260+
this.connection = new MockConnection(this.queue);
261+
262+
const onlineComponentProvider = new MockOnlineComponentProvider(this.connection);
261263
const offlineComponentProvider = await this.initializeOfflineComponentProvider(
262264
onlineComponentProvider,
263265
configuration,
@@ -271,7 +273,6 @@ abstract class TestRunner {
271273
this.sharedClientState = offlineComponentProvider.sharedClientState;
272274
this.persistence = offlineComponentProvider.persistence;
273275
this.localStore = offlineComponentProvider.localStore;
274-
this.connection = onlineComponentProvider.connection;
275276
this.remoteStore = onlineComponentProvider.remoteStore;
276277
this.syncEngine = onlineComponentProvider.syncEngine;
277278
this.eventManager = onlineComponentProvider.eventManager;

0 commit comments

Comments
 (0)