@@ -5,12 +5,13 @@ import { expect } from 'chai';
55import * as semver from 'semver' ;
66import * as sinon from 'sinon' ;
77
8- import { type CommandSucceededEvent } from '../../../lib/cmap/command_monitoring_events' ;
98import {
109 BSON ,
1110 type ClientSession ,
1211 type Collection ,
12+ type CommandFailedEvent ,
1313 type CommandStartedEvent ,
14+ type CommandSucceededEvent ,
1415 Connection ,
1516 type Db ,
1617 type FindCursor ,
@@ -174,8 +175,8 @@ describe('CSOT driver tests', { requires: { mongodb: '>=4.4' } }, () => {
174175
175176 describe ( 'server-side maxTimeMS errors are transformed' , ( ) => {
176177 let client : MongoClient ;
177- let commandsSucceeded ;
178- let commandsFailed ;
178+ let commandsSucceeded : CommandSucceededEvent [ ] ;
179+ let commandsFailed : CommandFailedEvent [ ] ;
179180
180181 beforeEach ( async function ( ) {
181182 client = this . configuration . newClient ( { timeoutMS : 500_000 , monitorCommands : true } ) ;
@@ -341,8 +342,11 @@ describe('CSOT driver tests', { requires: { mongodb: '>=4.4' } }, () => {
341342 } ;
342343
343344 beforeEach ( async function ( ) {
344- internalClient = this . configuration . newClient ( undefined ) ;
345- await internalClient . db ( 'db' ) . dropCollection ( 'coll' ) ;
345+ internalClient = this . configuration . newClient ( ) ;
346+ await internalClient
347+ . db ( 'db' )
348+ . dropCollection ( 'coll' )
349+ . catch ( ( ) => null ) ;
346350 await internalClient
347351 . db ( 'db' )
348352 . collection ( 'coll' )
@@ -444,8 +448,11 @@ describe('CSOT driver tests', { requires: { mongodb: '>=4.4' } }, () => {
444448 } ;
445449
446450 beforeEach ( async function ( ) {
447- internalClient = this . configuration . newClient ( undefined ) ;
448- await internalClient . db ( 'db' ) . dropCollection ( 'coll' ) ;
451+ internalClient = this . configuration . newClient ( ) ;
452+ await internalClient
453+ . db ( 'db' )
454+ . dropCollection ( 'coll' )
455+ . catch ( ( ) => null ) ;
449456 await internalClient
450457 . db ( 'db' )
451458 . collection ( 'coll' )
0 commit comments