Skip to content

Commit b4c2c19

Browse files
committed
Fix whitespace
1 parent b0fb1d1 commit b4c2c19

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

packages/firestore/test/integration/api_internal/transaction.test.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ apiDescribe.only(
133133
});
134134
});
135135

136-
137136
it('should fail transaction (maxAttempts: default) when reading a doc twice with different versions', async () => {
138137
await withTestDb(persistence, async db => {
139138
asyncQueue(db).skipDelaysForTimerId(TimerId.TransactionRetry);
@@ -147,13 +146,13 @@ apiDescribe.only(
147146
await transaction.get(docRef);
148147
// Do a write outside of the transaction. Because the transaction
149148
// will retry, set the document to a different value each time.
150-
await setDoc(docRef, {count: 1234 + counter});
149+
await setDoc(docRef, { count: 1234 + counter });
151150
// Get the docRef again in the transaction with the new
152151
// version.
153152
await transaction.get(docRef);
154153
// Now try to update the docRef from within the transaction.
155154
// This should fail, because we read 15 earlier.
156-
await transaction.set(docRef, {count: 16});
155+
await transaction.set(docRef, { count: 16 });
157156
});
158157
expect.fail('transaction should fail');
159158
} catch (err) {
@@ -176,20 +175,24 @@ apiDescribe.only(
176175
let counter = 0;
177176
await setDoc(docRef, { count: 15 });
178177
try {
179-
await runTransaction(db, async transaction => {
180-
counter++;
181-
// Get the docRef once.
182-
await transaction.get(docRef);
183-
// Do a write outside of the transaction. Because the transaction
184-
// will retry, set the document to a different value each time.
185-
await setDoc(docRef, {count: 1234 + counter});
186-
// Get the docRef again in the transaction with the new
187-
// version.
188-
await transaction.get(docRef);
189-
// Now try to update the docRef from within the transaction.
190-
// This should fail, because we read 15 earlier.
191-
await transaction.set(docRef, {count: 16});
192-
}, options);
178+
await runTransaction(
179+
db,
180+
async transaction => {
181+
counter++;
182+
// Get the docRef once.
183+
await transaction.get(docRef);
184+
// Do a write outside of the transaction. Because the transaction
185+
// will retry, set the document to a different value each time.
186+
await setDoc(docRef, { count: 1234 + counter });
187+
// Get the docRef again in the transaction with the new
188+
// version.
189+
await transaction.get(docRef);
190+
// Now try to update the docRef from within the transaction.
191+
// This should fail, because we read 15 earlier.
192+
await transaction.set(docRef, { count: 16 });
193+
},
194+
options
195+
);
193196
expect.fail('transaction should fail');
194197
} catch (err) {
195198
expect(err).to.exist;

0 commit comments

Comments
 (0)