Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions dev/system-test/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,12 @@ describe('Firestore class', () => {
expect(docs[1].data()!.toString()).to.deep.equal('post2, by author2');
});

it('cannot make calls after the client has been terminated', () => {
it('cannot make calls after the client has been terminated', async () => {
const ref1 = randomCol.doc('doc1');
return firestore
.terminate()
.then(() => {
return ref1.set({foo: 100});
})
.then(() => Promise.reject('set() should have failed'))
.catch(err => {
expect(err.message).to.equal('The client has already been terminated');
});
await firestore.terminate();
return expect(ref1.set({foo: 100})).to.eventually.be.rejectedWith(
'The client has already been terminated',
);
});

it('throws an error if terminate() is called with active listeners', async () => {
Expand All @@ -582,7 +577,7 @@ describe('Firestore class', () => {
it('throws an error if terminate() is called with pending BulkWriter operations', async () => {
const writer = firestore.bulkWriter();
const ref = randomCol.doc('doc-1');
writer.set(ref, {foo: 'bar'});
void writer.set(ref, {foo: 'bar'});
await expect(firestore.terminate()).to.eventually.be.rejectedWith(
'All onSnapshot() listeners must be unsubscribed, and all BulkWriter ' +
'instances must be closed before terminating the client. There are 0 ' +
Expand Down Expand Up @@ -1217,7 +1212,7 @@ describe('DocumentReference class', () => {
});

// tslint:disable-next-line:only-arrow-function
it('can add and delete fields sequentially', function () {
it('can add and delete fields sequentially', async function () {
this.timeout(30 * 1000);

const ref = randomCol.doc('doc');
Expand Down Expand Up @@ -1287,7 +1282,7 @@ describe('DocumentReference class', () => {
});
}

return promise;
await promise;
});

// tslint:disable-next-line:only-arrow-function
Expand Down Expand Up @@ -1555,7 +1550,7 @@ describe('DocumentReference class', () => {
() => {
unsubscribe1();
unsubscribe2();
Promise.all(promises).then(() => done());
void Promise.all(promises).then(() => done());
},
];

Expand Down Expand Up @@ -1595,7 +1590,7 @@ describe('DocumentReference class', () => {
() => {
unsubscribe1();
unsubscribe2();
Promise.all(promises).then(() => done());
void Promise.all(promises).then(() => done());
},
];

Expand Down Expand Up @@ -3161,7 +3156,7 @@ describe('Query class', () => {
const ref1 = randomCol.doc('doc1');
const ref2 = randomCol.doc('doc2');

Promise.all([ref1.set({foo: 'a'}), ref2.set({foo: 'b'})]).then(() => {
void Promise.all([ref1.set({foo: 'a'}), ref2.set({foo: 'b'})]).then(() => {
return randomCol
.stream()
.on('data', d => {
Expand Down Expand Up @@ -5208,7 +5203,7 @@ describe('Aggregation queries', () => {
});

it("terminate doesn't crash when there is aggregate query in flight", async () => {
col.aggregate({count: AggregateField.count()}).get();
void col.aggregate({count: AggregateField.count()}).get();
await firestore.terminate();
});

Expand Down Expand Up @@ -7048,12 +7043,12 @@ describe('WriteBatch class', () => {
});
});

it('has a full stack trace if set() errors', () => {
it('has a full stack trace if set() errors', async () => {
// Use an invalid document name that the backend will reject.
const ref = randomCol.doc('__doc__');
const batch = firestore.batch();
batch.set(ref, {foo: 'a'});
return batch
await batch
.commit()
.then(() => Promise.reject('commit() should have failed'))
.catch((err: Error) => {
Expand Down Expand Up @@ -7265,7 +7260,7 @@ describe('BulkWriter class', () => {

it('can terminate once BulkWriter is closed', async () => {
const ref = randomCol.doc('doc1');
writer.set(ref, {foo: 'bar'});
void writer.set(ref, {foo: 'bar'});
await writer.close();
return firestore.terminate();
});
Expand Down
10 changes: 5 additions & 5 deletions dev/system-test/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,11 +980,11 @@ describe('Tracing Tests', () => {
await runFirestoreOperationInRootSpan(async () => {
const bulkWriter = firestore.bulkWriter();
// No need to await the set operations as 'close()' will commit all writes before closing.
bulkWriter.set(firestore.collection('foo').doc(), {foo: 1});
bulkWriter.set(firestore.collection('foo').doc(), {foo: 2});
bulkWriter.set(firestore.collection('foo').doc(), {foo: 3});
bulkWriter.set(firestore.collection('foo').doc(), {foo: 4});
bulkWriter.set(firestore.collection('foo').doc(), {foo: 5});
void bulkWriter.set(firestore.collection('foo').doc(), {foo: 1});
void bulkWriter.set(firestore.collection('foo').doc(), {foo: 2});
void bulkWriter.set(firestore.collection('foo').doc(), {foo: 3});
void bulkWriter.set(firestore.collection('foo').doc(), {foo: 4});
void bulkWriter.set(firestore.collection('foo').doc(), {foo: 5});
await bulkWriter.close();
});

Expand Down
2 changes: 1 addition & 1 deletion dev/test/backoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('ExponentialBackoff', () => {
// The timeout handler for this test simply idles forever.
setTimeoutHandler(() => {});

backoff.backoffAndWait().then(nop);
void backoff.backoffAndWait().then(nop);
await expect(backoff.backoffAndWait()).to.eventually.be.rejectedWith(
'A backoff operation is already in progress.',
);
Expand Down
Loading
Loading