I want to understand Angular unit testing, and not just implement what 
works. It seems there are two ways to inject dependency mocks into a 
controller for testing: to set up the dependency using ngMock/$provide/
$inject, or to map a function or object to the dependency name using the 
second parameter to $controller. If I understand correctly, $provide+$inject 
would provide that dependency for everything within scope (e.g., within a 
describe/suite), basically overriding the injection in AJS's usual DI 
process. However, since I'm typically testing only one controller within a 
scope, is the mapping object equivalent?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to