mccormicka/Mockgoose

createConnection is not return the connection

Closed this issue · 3 comments

Mongoose return the connection when i use it like this:
var conn = mongoose.createConnection('mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]', options); (from http://mongoosejs.com/docs/connections.html)

But mockgoose don't return the connection at all. Why is that? and how can i get it?

Tnx

I can confirm this. If I call mongoose.createConnection on a mongoose object that was previously mockgoose(mongoose)'d, createConnection returns undefined.

See this PR:
#198

resolved in 6.0.1, thank you for reporting this issue.