Closed mwinche closed 7 years ago
Zack and I were talking about this exact thing earlier today. Technically, $httpBackend doesn't completely mock all of $http, just the request part. So some people may want to fully mock out the service in their tests. For that reason this should probably be made a configuration setting.
I've thought of adding something like this. I've debated the value of just auto-injecting angular's built-in services, rather than requiring that they be mocked. I prefer it to tell me everytime I've forgotten to mock something (or to tell it explicitly that I don't want to mock it using mocks: { $http: quickmock.USE_ACTUAL }
). However, after talking to others, I think they feel differently and would rather it not expect them to mock those services. I think I'll change how it works and do what you're suggesting.
I think I want to implement it differently though. I have a few other edge cases that your PR won't handle. Thanks for bringing this to my attention. I'm going to close this PR, but do you mind adding an issue for it and I'll fix it as soon as I can?
@tennisgent I created the issue, close out this PR if you like.
Closing this pending the resolution of #7
@tennisgent, so while I love what quickmock does, I've found it difficult to work when it tries to mock things that are already handled (mostly $httpBackend). I'd rather just use those mocks by default.