Testing Underscores

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

AngularJS injectors understand aliased for core injectables such as $rootScope in unit tests. If you surround your injected object with underscores _$rootScope_ it will be understood and injected into your test by Angular. This allows you to use a local alias of the same name.