Hacker News new | ask | show | jobs
by mvzink 4622 days ago
Great article. One thing I wish got more coverage is testing directives: it's already much easier than most DOM-testing methods (though it can't replace selenium etc.), but doing it well and consistently has proven difficult and I don't test most of my directives. For example, I had to modify the triggerHandler function in Angular to allow sending fake key presses since it didn't have a built in way (at least a few months ago) to specify the "which" property on the event.

Also, If you're in Chicago, the Angular meetup group will be talking about testing on November 20th: http://www.meetup.com/AngularJS-Chicago/

1 comments

This. I've come to the conclusion that directive testing falls under two headers.

1, measuring the effects of the directive on the dom, e.g. rendering a list of orders. This reflects the state of the application and

2, e2e testing of directives with a real browser.

However, I'm not sure this is correct! I'd like to see some best practices listed by the Angular authors.