[tests][firestore] misc transactions
This commit is contained in:
parent
0ad00685b8
commit
5c2ea9728b
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user