You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mongoose.createConnection requires the first argument to be either a hostname or a URI. Mockgoose is calling it with the database name as the first argument. This causes connection.host to return the database name instead of the host name.
This matters because I'm creating multiple connections based on mongoose.connection.host.
What are your thoughts?
The text was updated successfully, but these errors were encountered:
I saw that the mock db object seemed at first to be using the uri I passed in to #connect() but then saw that the resulting db object has the host set to the database name part of the uri and the databaseName property is always 'test'.
In my tests I can stub the connect method and check that connect is called with the value I expect but this would be a nice to have.
See:
Mockgoose/Mockgoose.js
Line 60 in 4759714
mongoose.createConnection
requires the first argument to be either a hostname or a URI. Mockgoose is calling it with the database name as the first argument. This causesconnection.host
to return the database name instead of the host name.This matters because I'm creating multiple connections based on
mongoose.connection.host
.What are your thoughts?
The text was updated successfully, but these errors were encountered: