The fiddle example no longer works as written because the method signature
for angular.module(...) has changed. Use this line when declaring the
'testApp' fake module:
angular.module('testApp', [])
On Wednesday, June 26, 2013 at 1:40:07 PM UTC-4, Luis Farzati wrote:
>
> Thanks Eitan, you rock! :)
>
> btw - if you have a SO user and want to post your answer here:
> http://stackoverflow.com/questions/17305712/how-to-test-an-angularjs-provider-configuration
> I'll
> mark it as accepted.
>
> On Wednesday, June 26, 2013 7:47:48 AM UTC-3, Eitan Peer wrote:
>>
>> Hi,
>>
>> See this fiddle <http://jsfiddle.net/eitanp461/qTvMz/> for an example.
>>
>> Regards,
>> Eitan
>>
>> On Tuesday, June 25, 2013 10:20:53 PM UTC+3, Luis Farzati wrote:
>>>
>>> I have a provider defined as follows:
>>>
>>> (function(angular) {
>>>
>>> angular.module('myModule', []).provider('myService', function () {
>>> var service = {};
>>> service.configureSomething = function () { };
>>> service.$get = function () { return {}; };
>>> return service;});
>>> })(angular);
>>>
>>> *How can I test configureSomething()?*
>>>
>>> The example shown in the AngularJS documentation
>>> <http://docs.angularjs.org/api/AUTO.%24provide> assumes the provider is
>>> a public function rather than being an anonymous function passed inside
>>> .provider() within a (function(){})()approach.
>>>
>>> Please note that I don't want to test for the provider instance, I'm
>>> just interested in testing the configuration.
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Angular" 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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.