@@ -19,7 +19,7 @@ describe('MongoOptions', function () {
19
19
} ) ;
20
20
expect ( options . directConnection ) . to . be . true ;
21
21
expect ( options . domainsEnabled ) . to . be . false ;
22
- expect ( options . hosts ) . to . have . length ( 1 ) ;
22
+ expect ( options . hosts ) . has . length ( 1 ) ;
23
23
expect ( options . dbName ) . to . equal ( 'test' ) ;
24
24
expect ( options . prototype ) . to . not . exist ;
25
25
} ) ;
@@ -28,8 +28,8 @@ describe('MongoOptions', function () {
28
28
const options = parseOptions ( 'mongodb://localhost:27017' , { minSize : 2 , poolSize : 4 } ) ;
29
29
expect ( options ) . to . not . have . property ( 'minSize' ) ;
30
30
expect ( options ) . to . not . have . property ( 'poolSize' ) ;
31
- expect ( options ) . to . have . property ( 'maxPoolSize' , 4 ) ;
32
- expect ( options ) . to . have . property ( 'minPoolSize' , 2 ) ;
31
+ expect ( options ) . has . property ( 'maxPoolSize' , 4 ) ;
32
+ expect ( options ) . has . property ( 'minPoolSize' , 2 ) ;
33
33
} ) ;
34
34
35
35
it ( 'tls renames' , function ( ) {
@@ -61,14 +61,14 @@ describe('MongoOptions', function () {
61
61
expect ( options ) . to . not . have . property ( 'tlsCAFile' ) ;
62
62
expect ( options ) . to . not . have . property ( 'sslCRL' ) ;
63
63
expect ( options ) . to . not . have . property ( 'tlsCertificateKeyFilePassword' ) ;
64
- expect ( options ) . to . have . property ( 'ca' , 'tlsCAFile' ) ;
65
- expect ( options ) . to . have . property ( 'crl' , 'sslCRL' ) ;
66
- expect ( options ) . to . have . property ( 'cert' , 'tlsCertificateFile' ) ;
67
- expect ( options ) . to . have . property ( 'key' ) ;
68
- expect ( options . key ) . to . have . length ( 2 ) ;
69
- expect ( options ) . to . have . property ( 'passphrase' , 'tlsCertificateKeyFilePassword' ) ;
70
- expect ( options ) . to . have . property ( 'rejectUnauthorized' , false ) ;
71
- expect ( options ) . to . have . property ( 'tls' , true ) ;
64
+ expect ( options ) . has . property ( 'ca' , 'tlsCAFile' ) ;
65
+ expect ( options ) . has . property ( 'crl' , 'sslCRL' ) ;
66
+ expect ( options ) . has . property ( 'cert' , 'tlsCertificateFile' ) ;
67
+ expect ( options ) . has . property ( 'key' ) ;
68
+ expect ( options . key ) . has . length ( 2 ) ;
69
+ expect ( options ) . has . property ( 'passphrase' , 'tlsCertificateKeyFilePassword' ) ;
70
+ expect ( options ) . has . property ( 'rejectUnauthorized' , false ) ;
71
+ expect ( options ) . has . property ( 'tls' , true ) ;
72
72
} ) ;
73
73
74
74
const ALL_OPTIONS = {
@@ -165,10 +165,10 @@ describe('MongoOptions', function () {
165
165
const options = parseOptions ( 'mongodb://localhost:27017/' , ALL_OPTIONS ) ;
166
166
167
167
// Check consolidated options
168
- expect ( options ) . to . have . property ( 'writeConcern' ) ;
169
- expect ( options . writeConcern ) . to . have . property ( 'w' , 2 ) ;
170
- expect ( options . writeConcern ) . to . have . property ( 'fsync' , true ) ;
171
- expect ( options . writeConcern ) . to . have . property ( 'j' , true ) ;
168
+ expect ( options ) . has . property ( 'writeConcern' ) ;
169
+ expect ( options . writeConcern ) . has . property ( 'w' , 2 ) ;
170
+ expect ( options . writeConcern ) . to . not . have . property ( 'fsync' ) ;
171
+ expect ( options . writeConcern ) . has . property ( 'j' , true ) ;
172
172
} ) ;
173
173
174
174
const allURIOptions =
@@ -215,11 +215,15 @@ describe('MongoOptions', function () {
215
215
216
216
it ( 'All URI options' , function ( ) {
217
217
const options = parseOptions ( allURIOptions ) ;
218
- console . log ( options ) ;
218
+ expect ( options ) . has . property ( 'zlibCompressionLevel' , 2 ) ;
219
+
220
+ expect ( options ) . has . property ( 'writeConcern' ) ;
221
+ expect ( options . writeConcern ) . has . property ( 'w' , 'majority' ) ;
222
+ expect ( options . writeConcern ) . has . property ( 'wtimeout' , 2 ) ;
219
223
} ) ;
220
224
221
225
it ( 'srv' , function ( ) {
222
226
const options = parseOptions ( 'mongodb+srv://server.example.com/' ) ;
223
- expect ( options ) . to . have . property ( 'srv' , true ) ;
227
+ expect ( options ) . has . property ( 'srv' , true ) ;
224
228
} ) ;
225
229
} ) ;
0 commit comments