on isolate scope you don't assert scope values. but directive behaviour.
so in unit test you trigger some event or sth. that calls doStruff and 
assert expected result of doStruff.

On Friday, March 28, 2014 4:25:01 PM UTC+1, Nikita Tovstoles wrote:
>
> Sorry, John, I am not sure the above quite does it. This may or may not 
> matter, but I was thinking of a directive with isolate scope, ie:
>
> app.directive('foobar', function(){
> return {
> restrict: 'E',
> scope: {},
> link: function(scope){
>   scope.doStuff = function(){};
> }
> };
> });
>
> how would you unit-test doStuff()? in your example, you're asserting on 
> the same scope as was used to compile directive, but in this case scope is 
> a child of that scope - how does one get at it?
>
> -nikita
>
>
> On Fri, Mar 28, 2014 at 7:33 AM, John Walker 
> <[email protected]<javascript:>
> > wrote:
>
>>  Sorry, i just realized you were asking about scope functions, not scope 
>>>>> properties. If that doesn't give you what you need, let me know and i'll 
>>>>> throw a function in the unit test. 
>>>>
>>>>
>>>>  -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "AngularJS" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/angular/1yiCh41gb28/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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