Browse Source

Add tests for connection string parsing

saintedlama/travis-non-legacy
saintedlama 9 years ago
parent
commit
f9ab36395a
  1. 18
      test/test-connection-strings.js

18
test/test-connection-strings.js

@ -0,0 +1,18 @@
var test = require('tape')
var mongojs = require('../')
test('connection string parsing', function (t) {
var db = mongojs('mongodb://localhost,localhost:28017/test', ['a'])
t.equal(db._dbname, 'test')
db = mongojs('test', ['a'])
t.equal(db._dbname, 'test')
db = mongojs('mongodb://localhost/test', ['a'])
t.equal(db._dbname, 'test')
db = mongojs('localhost/test', ['a'])
t.equal(db._dbname, 'test')
t.end()
})
Loading…
Cancel
Save