@@ -5,12 +5,13 @@ import { expect } from 'chai';
5
5
import * as semver from 'semver' ;
6
6
import * as sinon from 'sinon' ;
7
7
8
- import { type CommandSucceededEvent } from '../../../lib/cmap/command_monitoring_events' ;
9
8
import {
10
9
BSON ,
11
10
type ClientSession ,
12
11
type Collection ,
12
+ type CommandFailedEvent ,
13
13
type CommandStartedEvent ,
14
+ type CommandSucceededEvent ,
14
15
Connection ,
15
16
type Db ,
16
17
type FindCursor ,
@@ -174,8 +175,8 @@ describe('CSOT driver tests', { requires: { mongodb: '>=4.4' } }, () => {
174
175
175
176
describe ( 'server-side maxTimeMS errors are transformed' , ( ) => {
176
177
let client : MongoClient ;
177
- let commandsSucceeded ;
178
- let commandsFailed ;
178
+ let commandsSucceeded : CommandSucceededEvent [ ] ;
179
+ let commandsFailed : CommandFailedEvent [ ] ;
179
180
180
181
beforeEach ( async function ( ) {
181
182
client = this . configuration . newClient ( { timeoutMS : 500_000 , monitorCommands : true } ) ;
@@ -341,8 +342,11 @@ describe('CSOT driver tests', { requires: { mongodb: '>=4.4' } }, () => {
341
342
} ;
342
343
343
344
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 ) ;
346
350
await internalClient
347
351
. db ( 'db' )
348
352
. collection ( 'coll' )
@@ -444,8 +448,11 @@ describe('CSOT driver tests', { requires: { mongodb: '>=4.4' } }, () => {
444
448
} ;
445
449
446
450
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 ) ;
449
456
await internalClient
450
457
. db ( 'db' )
451
458
. collection ( 'coll' )
0 commit comments