My provider definition looks like this:
(function(angular) {
angular.module('myModule', [])
.provider('myService', function () {
var service = {};
service.configureSomething = function () { };
service.$get = function () { return {}; };
return service;
});
})(angular);
How do I go about testing configureSomething()
?
In the AngularJS documentation, the provided example assumes the provider is a public function rather than an anonymous function passed inside .provider()
using a (function(){})()
approach.
I specifically want to test the configuration and not focus on testing for the provider instance.