Skip to content

Commit

Permalink
Fix more compiler errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinnot committed Jan 12, 2018
1 parent 6cdf964 commit a86e26b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ apiDescribe('Server Timestamps', persistence => {
it('work via transaction set()', () => {
return withTestSetup(() => {
return docRef.firestore
.runTransaction(txn => {
.runTransaction(async txn => {
txn.set(docRef, setData);
})
.then(() => waitForRemoteEvent());
Expand All @@ -152,7 +152,7 @@ apiDescribe('Server Timestamps', persistence => {
return withTestSetup(() => {
return writeInitialData()
.then(() =>
docRef.firestore.runTransaction(txn => {
docRef.firestore.runTransaction(async txn => {
txn.update(docRef, updateData);
})
)
Expand All @@ -176,7 +176,7 @@ apiDescribe('Server Timestamps', persistence => {
it('fail via transaction update() on nonexistent document.', () => {
return withTestSetup(() => {
return docRef.firestore
.runTransaction(txn => {
.runTransaction(async txn => {
txn.update(docRef, updateData);
})
.then(
Expand Down
10 changes: 5 additions & 5 deletions packages/firestore/test/integration/api/transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ apiDescribe('Database transactions', persistence => {
.then(snapshot => {
expect(snapshot).to.exist;
expect(snapshot.data()['foo']).to.equal('bar');
return db.runTransaction(transaction => {
return db.runTransaction(async transaction => {
transaction.delete(doc);
});
})
Expand Down Expand Up @@ -185,7 +185,7 @@ apiDescribe('Database transactions', persistence => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('towns').doc();
return db
.runTransaction(transaction => {
.runTransaction(async transaction => {
transaction.set(doc, { a: 'b' }).set(doc, { c: 'd' });
})
.then(() => {
Expand All @@ -202,7 +202,7 @@ apiDescribe('Database transactions', persistence => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('towns').doc();
return db
.runTransaction(transaction => {
.runTransaction(async transaction => {
transaction.set(doc, { a: 'b', nested: { a: 'b' } }).set(
doc,
{ c: 'd', nested: { c: 'd' } },
Expand Down Expand Up @@ -354,7 +354,7 @@ apiDescribe('Database transactions', persistence => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('counters').doc();
return db
.runTransaction(transaction => {
.runTransaction(async transaction => {
transaction.set(doc, initialData);
transaction.update(
doc,
Expand Down Expand Up @@ -533,7 +533,7 @@ apiDescribe('Database transactions', persistence => {

it('are successful with no transaction operations', () => {
return integrationHelpers.withTestDb(persistence, db => {
return db.runTransaction(txn => {});
return db.runTransaction(async txn => {});
});
});

Expand Down
6 changes: 3 additions & 3 deletions packages/firestore/test/integration/api/validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ apiDescribe('Validation:', persistence => {
.commit();
})
.then(() => {
return ref.firestore.runTransaction(txn => {
return ref.firestore.runTransaction(async txn => {
// Note ref2 does not exist at this point so set that and update ref.
txn.update(ref, data);
txn.set(ref2, data);
Expand Down Expand Up @@ -462,7 +462,7 @@ apiDescribe('Validation:', persistence => {
const reason =
'Provided document reference is from a different Firestore instance.';
const data = { foo: 1 };
return db.runTransaction(txn => {
return db.runTransaction(async txn => {
expect(() => txn.get(badRef)).to.throw(reason);
expect(() => txn.set(badRef, data)).to.throw(reason);
expect(() => txn.update(badRef, data)).to.throw(reason);
Expand Down Expand Up @@ -750,7 +750,7 @@ function expectWriteToFail(
);
}

return docRef.firestore.runTransaction(txn => {
return docRef.firestore.runTransaction(async txn => {
if (includeSets) {
expect(() => txn.set(docRef, data)).to.throw(error('Transaction.set'));
}
Expand Down

0 comments on commit a86e26b

Please sign in to comment.