From 258b929e86b5806e7a3b240cbe397753962a9aff Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Wed, 16 Oct 2019 12:03:25 -0400 Subject: [PATCH] test(connection): more cleanup re: #8209 --- test/connection.test.js | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/test/connection.test.js b/test/connection.test.js index 0126d7f6ded..c6793e01f0c 100644 --- a/test/connection.test.js +++ b/test/connection.test.js @@ -500,31 +500,6 @@ describe('connections:', function() { }); describe('connect callbacks', function() { - it('execute with user:pwd connection strings', function(done) { - const db = mongoose.createConnection('mongodb://aaron:psw@localhost:27000/fake', { useNewUrlParser: true }, function() { - done(); - }); - db.catch(() => {}); - db.on('error', function(err) { - assert.ok(err); - }); - db.close(); - }); - it('execute without user:pwd connection strings', function(done) { - const db = mongoose.createConnection('mongodb://localhost/fake', { useNewUrlParser: true }, function() { - }); - db.on('error', function(err) { - assert.ok(err); - }); - assert.equal(typeof db.options, 'object'); - assert.equal(db.user, undefined); - assert.equal(db.name, 'fake'); - assert.equal(db.host, 'localhost'); - assert.equal(db.port, 27017); - db.close(); - setTimeout(done, 10); - }); - it('should return an error if malformed uri passed', function(done) { const db = mongoose.createConnection('mongodb:///fake', { useNewUrlParser: true }, function(err) { assert.ok(/hostname/.test(err.message)); @@ -533,16 +508,6 @@ describe('connections:', function() { db.close(); assert.ok(!db.options); }); - it('should use admin db if not specified and user/pass specified', function(done) { - const db = mongoose.createConnection('mongodb://u:p@localhost/admin', { useNewUrlParser: true }, function() { - done(); - }); - assert.equal(typeof db.options, 'object'); - assert.equal(db.name, 'admin'); - assert.equal(db.host, 'localhost'); - assert.equal(db.port, 27017); - db.close(); - }); }); describe('errors', function() {