Skip to content

Commit 5eb19a1

Browse files
committed
skip test if persistence is enabled
1 parent d53dddc commit 5eb19a1

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

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

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,30 +1615,34 @@ apiDescribe('Queries', (persistence: boolean) => {
16151615
});
16161616
});
16171617
});
1618-
1619-
it('can raise expected snapshot when resume query after deleting docs', () => {
1620-
const testDocs = {};
1621-
for (let i = 1; i <= 100; i++) {
1622-
Object.assign(testDocs, { ['doc' + i]: { key: i } });
1623-
}
1624-
return withTestCollection(persistence, testDocs, async (coll, db) => {
1625-
const snapshot1 = await getDocs(coll);
1626-
expect(snapshot1.size).to.equal(100);
1627-
// Delete 50 docs in transaction so that it doesn't affect local cache.
1628-
await runTransaction(db, async txn => {
1629-
for (let i = 1; i <= 50; i++) {
1630-
txn.delete(doc(coll, 'doc' + i));
1631-
}
1618+
1619+
// eslint-disable-next-line no-restricted-properties
1620+
(persistence ? it.skip: it)(
1621+
'can raise expected snapshot when resume query after deleting docs',
1622+
() => {
1623+
const testDocs = {};
1624+
for (let i = 1; i <= 100; i++) {
1625+
Object.assign(testDocs, { ['doc' + i]: { key: i } });
1626+
}
1627+
return withTestCollection(persistence, testDocs, async (coll, db) => {
1628+
const snapshot1 = await getDocs(coll);
1629+
expect(snapshot1.size).to.equal(100);
1630+
// Delete 50 docs in transaction so that it doesn't affect local cache.
1631+
await runTransaction(db, async txn => {
1632+
for (let i = 1; i <= 50; i++) {
1633+
txn.delete(doc(coll, 'doc' + i));
1634+
}
1635+
});
1636+
// Wait 10 seconds, during which the watch will stop tracking the query
1637+
// and will send an existence filter rather than "delete" events.
1638+
await (function () {
1639+
return new Promise(resolve => setTimeout(resolve, 10000));
1640+
})();
1641+
const snapshot2 = await getDocs(coll);
1642+
expect(snapshot2.size).to.equal(50);
16321643
});
1633-
// Wait 10 seconds, during which the watch will stop tracking the query
1634-
// and will send an existence filter rather than "delete" events.
1635-
await (function () {
1636-
return new Promise(resolve => setTimeout(resolve, 10000));
1637-
})();
1638-
const snapshot2 = await getDocs(coll);
1639-
expect(snapshot2.size).to.equal(50);
1640-
});
1641-
}).timeout('15s');
1644+
}
1645+
).timeout('20s');
16421646
});
16431647

16441648
function verifyDocumentChange<T>(

0 commit comments

Comments
 (0)