A great article in a series of AngularJS articles, written by Matias Niemelä.
Unit Testing Best Practices in AngularJS
11–17 of 17 posts
Re: Unit Testing Best Practices in AngularJS
#12Client side testable code is one of the pinnacle of AngularJS. Reuseable declarative UI's through Directives, reuseable business logic throug Services and view models (controllers) having only knowledge of views is a really good for maintainablity of a complex javascript app. AngualrJS can beat any framework out there (Backbone, Ember, etc.) when it comes to having testable & manageable code. If your product is going…
Re: Unit Testing Best Practices in AngularJS
#13Also, If you're in Chicago, the Angular meetup group will be talking about testing on November 20th: http://www.meetup.com/AngularJS-Chicago/
Re: Unit Testing Best Practices in AngularJS
#14Client side testable code is one of the pinnacle of AngularJS. Reuseable declarative UI's through Directives, reuseable business logic throug Services and view models (controllers) having only knowledge of views is a really good for maintainablity of a complex javascript app. AngualrJS can beat any framework out there (Backbone, Ember, etc.) when it comes to having testable & manageable code. If your product is going…
Would you mind clarifying on how AngularJS is better than BackboneJS when it comes to having testable & manageable code? I am currently working setting up a unit testing environment with BackboneJS, it seems to be working well. What major differences exist when you test the two?
1. DI.
2. Clear separation of concerns.
I believe that writing testable Javascript has been possible since the name Javascript was invented. Angular.js has made it easier by doing its best to force you to write testable code.Re: Unit Testing Best Practices in AngularJS
#15Great 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 m…
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.
Re: Unit Testing Best Practices in AngularJS
#16Earlier quoted context omitted.
Would you mind clarifying on how AngularJS is better than BackboneJS when it comes to having testable & manageable code? I am currently working setting up a unit testing environment with BackboneJS, it seems to be working well. What major differences exist when you test the two?
1. DI. 2. Clear separation of concerns. I believe that writing testable Javascript has been possible since the name Javascript was invented. Angular.js has made it easier by doing its best to force you to write testable code.
Re: Unit Testing Best Practices in AngularJS
#17Earlier quoted context omitted.
1. DI. 2. Clear separation of concerns. I believe that writing testable Javascript has been possible since the name Javascript was invented. Angular.js has made it easier by doing its best to force you to write testable code.
you can use DI in backbone and clearly seperate your concerns as well. It is just not as much enforced in the framework (not opinionated)