O'Reilly logo

Developing an Angular 2 Edge by Ran Wahle, Mary Gualtieri, Wojciech Kwiatek, Suguru Inatomi, Filip Lauc, Troy Mott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Testing

One of the reasons AngularJS was introduced was a problem of testing front-end apps. It solved that problem quite nicely and version 2 follows that path despite being a totally new piece of code. What makes it a good choice is a separation of concerns. We’ll focus mostly on unit testing here. Its responsibility is to ensure that every single function of a system works fine without being even aware of any other part. If the chosen framework (or library) doesn’t help with such a separation, and doesn’t give ability of mocking dependencies, it is really hard to do it right over time (or even impossible). We won’t focus on the test setup, so please take your time to use angular-cli or any other starter project that suites you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required