Closed ahalterman closed 8 years ago
Gross. Obviously this test is only going to work if Mordecai is running on Travis, which will require docker-compose
and 20 minutes. @johnb30, worth it?
You'd want to build a mock of the object somehow. You're not wanting to actually test whether mordecai returns the right results. Instead you're testing if you can send a thing and then process the results in the proper manner. Something like this might help.
I'm merging now with just the minimal test and the documentation. Better test coverage will require a significant re-writing of the geolocation functions. See #99.
The unit tests only covers the query to the Mordecai service, not the larger pipeline, because as configured it has to hit the Mongo db again. We could break apart the
mordecai
function into a db calling function and an info bundling function, but I think the potential for messing things up there is greater than the benefit from having better tests.