File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/firestore/test/unit/specs Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -121,14 +121,16 @@ function failTransactionIfNeeded(
121
121
}
122
122
123
123
export class MockOnlineComponentProvider extends OnlineComponentProvider {
124
- connection ! : MockConnection ;
124
+ constructor ( private readonly connection : MockConnection ) {
125
+ super ( ) ;
126
+ }
125
127
126
128
createDatastore ( cfg : ComponentConfiguration ) : Datastore {
127
129
const serializer = new JsonProtoSerializer (
128
130
cfg . databaseInfo . databaseId ,
129
131
/* useProto3Json= */ true
130
132
) ;
131
- return newDatastore ( cfg . credentials , new MockConnection ( cfg . asyncQueue ) , serializer ) ;
133
+ return newDatastore ( cfg . credentials , this . connection , serializer ) ;
132
134
}
133
135
}
134
136
Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ abstract class TestRunner {
257
257
persistenceSettings : this . persistenceSettings
258
258
} ;
259
259
260
- const onlineComponentProvider = new MockOnlineComponentProvider ( ) ;
260
+ this . connection = new MockConnection ( this . queue ) ;
261
+
262
+ const onlineComponentProvider = new MockOnlineComponentProvider ( this . connection ) ;
261
263
const offlineComponentProvider = await this . initializeOfflineComponentProvider (
262
264
onlineComponentProvider ,
263
265
configuration ,
@@ -271,7 +273,6 @@ abstract class TestRunner {
271
273
this . sharedClientState = offlineComponentProvider . sharedClientState ;
272
274
this . persistence = offlineComponentProvider . persistence ;
273
275
this . localStore = offlineComponentProvider . localStore ;
274
- this . connection = onlineComponentProvider . connection ;
275
276
this . remoteStore = onlineComponentProvider . remoteStore ;
276
277
this . syncEngine = onlineComponentProvider . syncEngine ;
277
278
this . eventManager = onlineComponentProvider . eventManager ;
You can’t perform that action at this time.
0 commit comments