daniellmb / angular-test-patterns

A High-Quality Guide for Testing Angular 1.x
MIT License
867 stars 100 forks source link

Services that make http calls #6

Closed victormejia closed 9 years ago

victormejia commented 10 years ago

Would be great to have a section that shows how to test services that make http calls.

lazychino commented 9 years ago

Here are the ngMock examples https://docs.angularjs.org/api/ngMock/service/$httpBackend. But would be nice to have that here

yanivefraim commented 9 years ago

I was thinking of adding a service api call to a mock api and adding a test for it. @daniellmb , what do you think? Can I add a PR here for that?

daniellmb commented 9 years ago

@yanivefraim yeah, I think showing how to mock and test an $http call would be a great test pattern to add in the project.

yanivefraim commented 9 years ago

@daniellmb Cool, I am already on it. Will take some time - I'm pretty busy, trying to free some time to do this (just did some similar tests with $httpbackend on another project, will use it here)

yanivefraim commented 9 years ago

Merged, issue can be closed

daniellmb commented 9 years ago

To you @yanivefraim for getting this in!