How to build a large Angular.js application | AngularJS |

Angular.js is built from the ground up with testing in mind. In our opinion this makes Angular different from all other frameworks out there. It is the reason we chose it.

This testability is due to the feature set of Angular and the tooling available. Feature wise,dependency injection (DI), modules, directives, data binding, and the internal event loop all work together to create a testable architecture.

Angular maintains its own event loop outside the browser event loop to do dirty checking and make sure data is in sync. It will check all known objects for changes on every loop tick. This is done asynchronously. Because this loop is maintained by Angular, you can flush the queue of any outstanding request or pending change at any time, meaning you can test async code in a synchronous manner.

The test runner Karma, makes testing directives exceptionally easy. It transparently loads your templates as scripts and exposes them as Angular modules. You can use the same concept to package your app for production.

Via Jan Hesse