Book Image

Learning Single-page Web Application Development

Book Image

Learning Single-page Web Application Development

Overview of this book

Table of Contents (15 chapters)
Learning Single-page Web Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 7. Testing Angular SPA with Karma and Protractor

In this chapter, we'll dive a bit deeper into the AngularJS Framework and understand some very important points about testing on SPA.

As we mentioned in the previous chapters, SPA transfers MVC responsibility to JavaScript that runs on the client side (the browser). We must write the tests in the same way as we do when dealing with MVC on server-side languages.

The AngularJS framework is designed to be highly testable and because of that we have some tools that facilitate this process. Today, writing test cases is part of the web development process of every programmer, whether frontend or backend. Test-driven development is part of all agile methodologies and you should remember this. The sooner you start writing tests, the better it will be for you.

In the upcoming sections, we will see some basic concepts of tests, such as unit testing and integration testing (known as e2e testing) among other things. These are as follows:

  • Testing concepts...