The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Inject Jasmine Spies With $provide

Inject Jasmine Spies With $provide

1:49
One of the beautiful things about dependency injection in your AngularJS apps is the ability to replace dependencies in your unit tests. In this lesson Trevor looks at how to configure Jasmine spies as injectable replacements for dependencies for testing.
Watch this lesson now
Avatar
egghead.io

One of the beautiful things about dependency injection in your AngularJS apps is the ability to replace dependencies in your unit tests. In this lesson Trevor looks at how to configure Jasmine spies as injectable replacements for dependencies for testing.

Avatar
Albert

Question:

In the test "expect($scope.favoriteBooks).toEqual(favoriteBooks)", what is the relationship between this line of code and the profileSvcSpy? In other words: how is the connection between the controller and the service being tested?

Thx. -Albert

In reply to egghead.io
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?