@@ -552,17 +552,12 @@ describe('Firestore class', () => {
552552 expect ( docs [ 1 ] . data ( ) ! . toString ( ) ) . to . deep . equal ( 'post2, by author2' ) ;
553553 } ) ;
554554
555- it ( 'cannot make calls after the client has been terminated' , ( ) => {
555+ it ( 'cannot make calls after the client has been terminated' , async ( ) => {
556556 const ref1 = randomCol . doc ( 'doc1' ) ;
557- return firestore
558- . terminate ( )
559- . then ( ( ) => {
560- return ref1 . set ( { foo : 100 } ) ;
561- } )
562- . then ( ( ) => Promise . reject ( 'set() should have failed' ) )
563- . catch ( err => {
564- expect ( err . message ) . to . equal ( 'The client has already been terminated' ) ;
565- } ) ;
557+ await firestore . terminate ( ) ;
558+ return expect ( ref1 . set ( { foo : 100 } ) ) . to . eventually . be . rejectedWith (
559+ 'The client has already been terminated' ,
560+ ) ;
566561 } ) ;
567562
568563 it ( 'throws an error if terminate() is called with active listeners' , async ( ) => {
@@ -582,7 +577,7 @@ describe('Firestore class', () => {
582577 it ( 'throws an error if terminate() is called with pending BulkWriter operations' , async ( ) => {
583578 const writer = firestore . bulkWriter ( ) ;
584579 const ref = randomCol . doc ( 'doc-1' ) ;
585- writer . set ( ref , { foo : 'bar' } ) ;
580+ void writer . set ( ref , { foo : 'bar' } ) ;
586581 await expect ( firestore . terminate ( ) ) . to . eventually . be . rejectedWith (
587582 'All onSnapshot() listeners must be unsubscribed, and all BulkWriter ' +
588583 'instances must be closed before terminating the client. There are 0 ' +
@@ -1217,7 +1212,7 @@ describe('DocumentReference class', () => {
12171212 } ) ;
12181213
12191214 // tslint:disable-next-line:only-arrow-function
1220- it ( 'can add and delete fields sequentially' , function ( ) {
1215+ it ( 'can add and delete fields sequentially' , async function ( ) {
12211216 this . timeout ( 30 * 1000 ) ;
12221217
12231218 const ref = randomCol . doc ( 'doc' ) ;
@@ -1287,7 +1282,7 @@ describe('DocumentReference class', () => {
12871282 } ) ;
12881283 }
12891284
1290- return promise ;
1285+ await promise ;
12911286 } ) ;
12921287
12931288 // tslint:disable-next-line:only-arrow-function
@@ -1555,7 +1550,7 @@ describe('DocumentReference class', () => {
15551550 ( ) => {
15561551 unsubscribe1 ( ) ;
15571552 unsubscribe2 ( ) ;
1558- Promise . all ( promises ) . then ( ( ) => done ( ) ) ;
1553+ void Promise . all ( promises ) . then ( ( ) => done ( ) ) ;
15591554 } ,
15601555 ] ;
15611556
@@ -1595,7 +1590,7 @@ describe('DocumentReference class', () => {
15951590 ( ) => {
15961591 unsubscribe1 ( ) ;
15971592 unsubscribe2 ( ) ;
1598- Promise . all ( promises ) . then ( ( ) => done ( ) ) ;
1593+ void Promise . all ( promises ) . then ( ( ) => done ( ) ) ;
15991594 } ,
16001595 ] ;
16011596
@@ -3161,7 +3156,7 @@ describe('Query class', () => {
31613156 const ref1 = randomCol . doc ( 'doc1' ) ;
31623157 const ref2 = randomCol . doc ( 'doc2' ) ;
31633158
3164- Promise . all ( [ ref1 . set ( { foo : 'a' } ) , ref2 . set ( { foo : 'b' } ) ] ) . then ( ( ) => {
3159+ void Promise . all ( [ ref1 . set ( { foo : 'a' } ) , ref2 . set ( { foo : 'b' } ) ] ) . then ( ( ) => {
31653160 return randomCol
31663161 . stream ( )
31673162 . on ( 'data' , d => {
@@ -5208,7 +5203,7 @@ describe('Aggregation queries', () => {
52085203 } ) ;
52095204
52105205 it ( "terminate doesn't crash when there is aggregate query in flight" , async ( ) => {
5211- col . aggregate ( { count : AggregateField . count ( ) } ) . get ( ) ;
5206+ void col . aggregate ( { count : AggregateField . count ( ) } ) . get ( ) ;
52125207 await firestore . terminate ( ) ;
52135208 } ) ;
52145209
@@ -7048,12 +7043,12 @@ describe('WriteBatch class', () => {
70487043 } ) ;
70497044 } ) ;
70507045
7051- it ( 'has a full stack trace if set() errors' , ( ) => {
7046+ it ( 'has a full stack trace if set() errors' , async ( ) => {
70527047 // Use an invalid document name that the backend will reject.
70537048 const ref = randomCol . doc ( '__doc__' ) ;
70547049 const batch = firestore . batch ( ) ;
70557050 batch . set ( ref , { foo : 'a' } ) ;
7056- return batch
7051+ await batch
70577052 . commit ( )
70587053 . then ( ( ) => Promise . reject ( 'commit() should have failed' ) )
70597054 . catch ( ( err : Error ) => {
@@ -7265,7 +7260,7 @@ describe('BulkWriter class', () => {
72657260
72667261 it ( 'can terminate once BulkWriter is closed' , async ( ) => {
72677262 const ref = randomCol . doc ( 'doc1' ) ;
7268- writer . set ( ref , { foo : 'bar' } ) ;
7263+ void writer . set ( ref , { foo : 'bar' } ) ;
72697264 await writer . close ( ) ;
72707265 return firestore . terminate ( ) ;
72717266 } ) ;
0 commit comments