I have Angular (1.2.x) unit tests where I'm utilizing ngMock
. My project has a fixture system that relies on sinon.fakeServer
. For my unit tests, I'd prefer to use this as opposed to the $httpBackend
.
ngMockE2E
tests Angular provides a passthrough
method, however there isn't a clear equivalent for unit tests. The rationale seems to be that unit tests should never be passing-through (to a server) but in my situation I'm just trying to pass through to a non-Angular-dependent-mock.
My strategy right now is to create a shim that matches .whenGet
and .whenPost
requests and routes them to my fake server.
However, what would be better is simply "turning off" the $httpBackend
. Is there a way to do this?