Currently, I am working on unit tests for Angular (1.2.x) using ngMock
. In my project, there is a fixture system that relies on sinon.fakeServer
. Instead of using the $httpBackend
, I want to utilize this fixture system for my unit tests.
In ngMockE2E
tests, Angular offers a passthrough
method, but there isn't a clear equivalent for unit tests. The general consensus is that unit tests should not pass through to a server. However, in my case, I just want to pass through to a non-Angular-dependent mock.
My current approach involves creating a shim to match .whenGet
and .whenPost
requests and direct them to my fake server.
Yet, it would be more efficient if I could simply "turn off" the $httpBackend
. Is there a way to accomplish this?