Writing automated tests

Our application is working fine, which is great; however, going forward, you would probably tinker with the code, refactor it, add some additional features, and so on. While doing so, it's important to make sure that we don't break anything.

Moreover, because our app makes use of a third-party API, which at times may go down or change, this will cause our app to fail.

In order to detect any breakages, it is vital that we have some kind of automated tests that can be run periodically or every time something changes in our code.

We will use Karma to run our Unit tests and Protractor for our End-to-End Testing.

Writing Unit tests with Karma

Karma is a test runner to run JavaScript Unit tests. We can use Jasmine, Mocha, or QUnit ...

Get AngularJS Web Application Development Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.