Tuesday, 21 October 2014

how to write unit test for services of angularjs


1 test the service

a service:



unittest:






2 How to test a controller with service, how to mock the service:


this is the controller:



test this controller with a mocked service:




















No comments:

Post a comment