O'Reilly logo

AngularJS Directives Cookbook by Fernando Monteiro

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

How to test AngularJS apps using Karma and Karma Runner

Before we dive deep into custom directives testing, let's see how to configure and use the WebStorm. But first, let's build the baseline code for the next recipes.

Getting ready

As usual, we are still using the generator-angm to build the baseline code.

  1. Create a new folder and name it directive-unit-testing. Open your terminal window and type:
    yo angm
    
  2. Type directive-unit-testing and press Enter, Enter, Enter. At the end of the command, we can see all the versions installed; you will note that we are using the last stable version from AngularJS at the time of writing:
    bower install               json3#3.3.1
    bower install               es5-shim#3.1.0
    bower install               bootstrap#3.3.5
    bower install               angular-resource#1.4.7
    bower ...

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