2
0
mirror of synced 2025-02-03 10:03:29 +00:00

[tests][firestore] misc transactions

This commit is contained in:
Salakar 2018-04-09 19:03:07 +01:00
parent 0ad00685b8
commit 5c2ea9728b

View File

@ -1,6 +1,7 @@
const should = require('should');
describe('firestore.runTransaction', () => {
describe('firestore()', () => {
describe('runTransaction()', () => {
it('should set, update and delete transactionally and allow a return value', async () => {
let deleteMe = false;
const firestore = firebase.firestore();
@ -24,7 +25,9 @@ describe('firestore.runTransaction', () => {
const newValue = doc.data().value + 1;
if (newValue > 2) {
return Promise.reject(new Error('Value should not be greater than 2!'));
return Promise.reject(
new Error('Value should not be greater than 2!')
);
}
transaction.update(docRef, {
@ -70,4 +73,5 @@ describe('firestore.runTransaction', () => {
return Promise.resolve('Test Completed');
});
});
});