@@ -220,72 +220,72 @@ describe('Connection String', function () {
220
220
suites . forEach ( suite => {
221
221
describe ( suite . name , function ( ) {
222
222
suite . tests . forEach ( test => {
223
- // it(test.description, {
224
- // metadata: { requires: { topology: 'single' } },
225
- // test: function (done) {
226
- // if (skipTests.indexOf(test.description) !== -1) {
227
- // return this.skip();
228
- // }
229
-
230
- // const valid = test.valid;
231
- // parseConnectionString(test.uri, { caseTranslate: false }, function (err, result) {
232
- // if (valid === false) {
233
- // expect(err).to.exist;
234
- // expect(err).to.be.instanceOf(MongoParseError);
235
- // expect(result).to.not.exist;
236
- // } else {
237
- // expect(err).to.not.exist;
238
- // expect(result).to.exist;
239
-
240
- // // remove data we don't track
241
- // if (test.auth && test.auth.password === '') {
242
- // test.auth.password = null;
243
- // }
244
-
245
- // if (test.hosts != null) {
246
- // test.hosts = test.hosts.map(host => {
247
- // delete host.type;
248
- // host.host = punycode.toASCII(host.host);
249
- // return host;
250
- // });
251
-
252
- // // remove values that require no validation
253
- // test.hosts.forEach(host => {
254
- // Object.keys(host).forEach(key => {
255
- // if (host[key] == null) delete host[key];
256
- // });
257
- // });
258
-
259
- // expect(result.hosts).to.containSubset(test.hosts);
260
- // }
261
-
262
- // if (test.auth) {
263
- // if (test.auth.db != null) {
264
- // expect(result.auth).to.have.property('db');
265
- // expect(result.auth.db).to.eql(test.auth.db);
266
- // }
267
-
268
- // if (test.auth.username != null) {
269
- // expect(result.auth).to.have.property('username');
270
- // expect(result.auth.username).to.eql(test.auth.username);
271
- // }
272
-
273
- // if (test.auth.password != null) {
274
- // expect(result.auth).to.have.property('password');
275
- // expect(result.auth.password).to.eql(test.auth.password);
276
- // }
277
- // }
278
-
279
- // if (test.options != null) {
280
- // // it's possible we have options which are not explicitly included in the spec test
281
- // expect(result.options).to.deep.include(test.options);
282
- // }
283
- // }
284
-
285
- // done();
286
- // });
287
- // }
288
- // });
223
+ it ( test . description , {
224
+ metadata : { requires : { topology : 'single' } } ,
225
+ test : function ( done ) {
226
+ if ( skipTests . indexOf ( test . description ) !== - 1 ) {
227
+ return this . skip ( ) ;
228
+ }
229
+
230
+ const valid = test . valid ;
231
+ parseConnectionString ( test . uri , { caseTranslate : false } , function ( err , result ) {
232
+ if ( valid === false ) {
233
+ expect ( err ) . to . exist ;
234
+ expect ( err ) . to . be . instanceOf ( MongoParseError ) ;
235
+ expect ( result ) . to . not . exist ;
236
+ } else {
237
+ expect ( err ) . to . not . exist ;
238
+ expect ( result ) . to . exist ;
239
+
240
+ // remove data we don't track
241
+ if ( test . auth && test . auth . password === '' ) {
242
+ test . auth . password = null ;
243
+ }
244
+
245
+ if ( test . hosts != null ) {
246
+ test . hosts = test . hosts . map ( host => {
247
+ delete host . type ;
248
+ host . host = punycode . toASCII ( host . host ) ;
249
+ return host ;
250
+ } ) ;
251
+
252
+ // remove values that require no validation
253
+ test . hosts . forEach ( host => {
254
+ Object . keys ( host ) . forEach ( key => {
255
+ if ( host [ key ] == null ) delete host [ key ] ;
256
+ } ) ;
257
+ } ) ;
258
+
259
+ expect ( result . hosts ) . to . containSubset ( test . hosts ) ;
260
+ }
261
+
262
+ if ( test . auth ) {
263
+ if ( test . auth . db != null ) {
264
+ expect ( result . auth ) . to . have . property ( 'db' ) ;
265
+ expect ( result . auth . db ) . to . eql ( test . auth . db ) ;
266
+ }
267
+
268
+ if ( test . auth . username != null ) {
269
+ expect ( result . auth ) . to . have . property ( 'username' ) ;
270
+ expect ( result . auth . username ) . to . eql ( test . auth . username ) ;
271
+ }
272
+
273
+ if ( test . auth . password != null ) {
274
+ expect ( result . auth ) . to . have . property ( 'password' ) ;
275
+ expect ( result . auth . password ) . to . eql ( test . auth . password ) ;
276
+ }
277
+ }
278
+
279
+ if ( test . options != null ) {
280
+ // it's possible we have options which are not explicitly included in the spec test
281
+ expect ( result . options ) . to . deep . include ( test . options ) ;
282
+ }
283
+ }
284
+
285
+ done ( ) ;
286
+ } ) ;
287
+ }
288
+ } ) ;
289
289
290
290
it ( `${ test . description } -- new MongoOptions parser` , function ( ) {
291
291
if ( skipTests . includes ( test . description ) ) {
0 commit comments