Skip to content

Commit 9b6b0b3

Browse files
author
Thijs Vermeir
committed
test runTransaction after clearFirestoreData fails
1 parent 7c15fb0 commit 9b6b0b3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/rules-unit-testing/test/database.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,22 @@ describe('Testing Module Tests', function () {
301301
});
302302
});
303303

304+
it('should allow transaction after clearFirestoreData', async function () {
305+
await firebase.clearFirestoreData({
306+
projectId: 'foo'
307+
});
308+
const app = firebase.initializeTestApp({
309+
projectId: 'foo'
310+
});
311+
312+
const doc = app.firestore().doc('test/test');
313+
await firebase.assertSucceeds(
314+
app.firestore().runTransaction(async transaction => {
315+
await transaction.get(doc);
316+
})
317+
);
318+
});
319+
304320
it('apps() returns apps created with initializeTestApp', async function () {
305321
const numApps = firebase.apps().length;
306322
await firebase.initializeTestApp({ databaseName: 'foo', auth: undefined });

0 commit comments

Comments
 (0)