Closed mrusme closed 8 years ago
@vdemedes not sure what's wrong with Travis as npm test
returns successfully on my local machine.
I'm against this change, as this check could happen before Mongorito.connect()
and a final URL passed over there.
const url = process.env.MONGODB_URL || defaultUrl;
Mongorito.connect(url);
Simple enough and does not require any modification.
@vdemedes could you please point me to the location inside Mongorito, where the MONGODB_URL is being read? I grepped for "MONGODB_URL" and couldn't find anything in the source-code:
Searching 31 files for "MONGODB_URL"
0 matches
I'm not sure whether this is a misunderstanding. Let me describe the problem that led me to implement this PR:
As I'm using Docker to run the MongoDB, my MONGO_URL is not localhost but rather <someip>:<someport>
. Hence, in the current state of this project, I'm unable to run tests, as they have 'localhost' hard-coded inside the setup-method. This PR changes this and allowed me to simply specify the run command like this:
MONGO_URL=mongodb://192.168.99.100:32768/mongorito_test npm test
By that, I was able to run the tests. Now, if you're saying that there already is some MONGODB_URL
checking, I'm wondering where that was implemented, as I cannot find it.
Oh, sorry, I was on mobile and misunderstood the changes being made. Thanks ;)
Implementation of MONGO_URL for possibility to run tests via
MONGO_URL=mongodb://192.168.99.100:32768/mongorito_test npm test