In an ember-cli app, testing is done using ember-qunit.
I would like to mock HTTP requests, but have not been able to find a recommended way of doing this in the documentation.
I have found this thread which discusses this, but it appears to be out of date (for ember-cli anyway).
How do you mock HTTP requests?
This is how I mock HTTP requests. One improvement could be done by encapsulating
mockjax
with helper like:So you can easily switch for another library like
sinon
or whatever.I Hope this helps