@@ -25,8 +25,11 @@ import {
2525
2626describe ( 'MongoClient' , function ( ) {
2727 const client : MongoClient = {
28- listeners : ( ) => [ ]
29- } as MongoClient ;
28+ listeners : ( ) => [ ] ,
29+ on ( ) {
30+ return this ;
31+ }
32+ } as unknown as MongoClient ;
3033
3134 it ( 'programmatic options should override URI options' , function ( ) {
3235 const options = parseOptions ( 'mongodb://localhost:27017/test?directConnection=true' , client , {
@@ -76,34 +79,30 @@ describe('MongoClient', function () {
7679 expect ( options ) . has . property ( 'tls' , true ) ;
7780 } ) ;
7881
79- const ALL_OPTIONS = {
82+ const ALL_OPTIONS : MongoClientOptions = {
8083 appName : 'cats' ,
8184 auth : { username : 'username' , password : 'password' } ,
8285 authMechanism : 'SCRAM-SHA-1' ,
8386 authMechanismProperties : { SERVICE_NAME : 'service name here' } ,
8487 authSource : 'refer to dbName' ,
85- autoEncryption : { bypassAutoEncryption : true } ,
88+ autoEncryption : { bypassAutoEncryption : true , kmsProviders : { aws : { } } } ,
8689 checkKeys : true ,
87- checkServerIdentity : false ,
90+ checkServerIdentity : ( ) => undefined ,
8891 compressors : 'snappy,zlib' ,
8992 connectTimeoutMS : 123 ,
9093 directConnection : true ,
91- dbName : 'test' ,
9294 driverInfo : { name : 'MyDriver' , platform : 'moonOS' } ,
9395 family : 6 ,
9496 fieldsAsRaw : { rawField : true } ,
9597 forceServerObjectId : true ,
96- fsync : true ,
9798 heartbeatFrequencyMS : 3 ,
9899 ignoreUndefined : false ,
99- j : true ,
100- journal : false ,
100+ journal : true ,
101101 localThresholdMS : 3 ,
102102 maxConnecting : 5 ,
103103 maxIdleTimeMS : 3 ,
104104 maxPoolSize : 2 ,
105105 maxStalenessSeconds : 3 ,
106- minInternalBufferSize : 0 ,
107106 minPoolSize : 1 ,
108107 monitorCommands : true ,
109108 noDelay : true ,
@@ -136,7 +135,6 @@ describe('MongoClient', function () {
136135 w : 'majority' ,
137136 waitQueueTimeoutMS : 3 ,
138137 writeConcern : new WriteConcern ( 2 ) ,
139- wtimeout : 5 ,
140138 wtimeoutMS : 6 ,
141139 zlibCompressionLevel : 2
142140 } ;
@@ -150,7 +148,7 @@ describe('MongoClient', function () {
150148 // Check consolidated options
151149 expect ( options ) . has . property ( 'writeConcern' ) ;
152150 expect ( options . writeConcern ) . has . property ( 'w' , 2 ) ;
153- expect ( options . writeConcern ) . has . property ( 'j ' , true ) ;
151+ expect ( options . writeConcern ) . has . property ( 'journal ' , true ) ;
154152 } ) ;
155153
156154 const allURIOptions =
0 commit comments