Re: [AngularJS] pointers on how to test directives

37 views
Skip to first unread message

Pawel Kozlowski

unread,
Oct 3, 2012, 3:16:15 PM10/3/12
to ang...@googlegroups.com
The very good place to look for directives tests examples is ...
AngularJS source code since a large portion of the entire code-base
consists of directives and all those directives are well tested.

I recognize that browsing through the angular's code base might be
intimidating at first so fortunately there is this GithHub repo:
https://github.com/vojtajina/ng-directive-testing
with an excellent example of directive testing (bootstrap's tabs). The
repo was prepared for a meetup
(https://twitter.com/vojtajina/status/245792989878841344) so I hope
that the video records from this meetup will be available soon :-)

Cheers,
Pawel

On Tue, Oct 2, 2012 at 3:16 AM, Jen Carlile <j...@vannevartech.com> wrote:
> With the help of this excellent article I wrote my first directive -- a
> reusable graph widget using D3.
> While it's working in my app, I am having a hard time figuring out how to
> write tests for it. The angular seed app has one example of testing a
> directive, but I'm having a difficult time applying the example to my
> situation.
>
> Can anyone point me towards resources or examples of unit testing
> directives? or provide any general words of wisdom? Any pointers are
> appreciated.
>
> Here is a jsfiddle with the directive: http://jsfiddle.net/jcarlile/naxns/
> I'm using Jasmine for unit testing and haven't yet setup e2e testing
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en.
>
>



--
Question? Send a fiddle
(http://jsfiddle.net/pkozlowski_opensource/Q2NpJ/) or a plunk
(http://plnkr.co/)
Need help with jsFiddle? Check this:
http://pkozlowskios.wordpress.com/2012/08/12/using-jsfiddle-with-angularjs/

Looking for UI widget library for AngularJS? Here you go:
http://angular-ui.github.com/
Reply all
Reply to author
Forward
0 new messages