Skip to content

Commit af72d73

Browse files
committed
Only appy required test changes
1 parent c120983 commit af72d73

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

packages/firestore-compat/test/bundle.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ apiDescribe('Bundles', (persistence: boolean) => {
188188
await db.doc('coll-1/b').set({ k: 'b', bar: 0 });
189189

190190
const accumulator = new EventsAccumulator<firestore.QuerySnapshot>();
191-
const unsubscribe = db
192-
.collection('coll-1')
193-
.onSnapshot(accumulator.storeEvent);
191+
db.collection('coll-1').onSnapshot(accumulator.storeEvent);
194192
await accumulator.awaitEvent();
195193

196194
const progress = await db.loadBundle(
@@ -209,8 +207,6 @@ apiDescribe('Bundles', (persistence: boolean) => {
209207

210208
snap = await (await db.namedQuery('limit-to-last'))!.get();
211209
expect(toDataArray(snap)).to.deep.equal([{ k: 'a', bar: 0 }]);
212-
213-
unsubscribe();
214210
});
215211
});
216212

packages/firestore-compat/test/get_options.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ apiDescribe('GetOptions', (persistence: boolean) => {
5555

5656
it('get document while offline with default get options', () => {
5757
const initialData = { key: 'value' };
58-
return withTestDocAndInitialData(persistence, initialData, async docRef => {
58+
return withTestDocAndInitialData(persistence, initialData, docRef => {
5959
// Register a snapshot to force the data to stay in the cache and not be
6060
// garbage collected.
61-
const unsubscribe = docRef.onSnapshot(() => {});
62-
await docRef
61+
docRef.onSnapshot(() => {});
62+
return docRef
6363
.get()
6464
.then(ignored => docRef.firestore.disableNetwork())
6565
.then(() => docRef.get())
@@ -69,7 +69,6 @@ apiDescribe('GetOptions', (persistence: boolean) => {
6969
expect(doc.metadata.hasPendingWrites).to.be.false;
7070
expect(doc.data()).to.deep.equal(initialData);
7171
});
72-
unsubscribe();
7372
});
7473
});
7574

packages/firestore/test/integration/api/validation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ apiDescribe('Validation:', persistence => {
234234
validationIt(
235235
persistence,
236236
'disallows calling enableIndexedDbPersistence() after use',
237-
db => {
238-
//doc(db, 'foo/bar');
237+
async db => {
238+
await getDoc(doc(db, 'foo/bar'));
239239
expect(() => enableIndexedDbPersistence(db)).to.throw(
240240
'Firestore has already been started and persistence can no ' +
241241
'longer be enabled. You can only enable persistence before ' +

0 commit comments

Comments
 (0)