Using Karma with Angular

Here, we will walk through a TDD approach to an Angular component. By the end of this chapter, we should be able to do the following:

  • Feel confident about using Karma and its configuration
  • Understand the basic components of a Jasmine test
  • Start understanding the integration of a TDD approach in an Angular application

Getting Angular

Angular installation is not possible via Bower; as it was with Angular1, it has to be installed via npm. Bootstrapping the Angular application is not as simple as Angular1 because Angular doesn't use plain JavaScript. It uses TypeScript or ES6 (ES2015), both of which need to be compiled to plain JavaScript before running them.

We believe that most of the developer are already aware of the Angular ...

Get Angular Test-Driven Development - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.