Chapter 6. Testing in AngularJS

In this chapter, we will cover the following recipes:

  • Configuring and running your test environment in Yeoman and Grunt
  • Understanding Protractor
  • Incorporating E2E tests and Protractor in Grunt
  • Writing basic unit tests
  • Writing basic E2E tests
  • Setting up a simple mock backend server
  • Writing DAMP tests
  • Using the Page Object test pattern

Introduction

Since its inception, AngularJS has always been a framework built with maximum testability in mind. Developers are often averse to devoting substantial time towards creating a test suite for their application, yet we all know only too well how wrong things can go when untested or partially tested code is shipped to production.

One could fill an entire book with the various tools and ...

Get AngularJS Web Application Development Cookbook 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.