O'Reilly logo

AngularJS Testing Cookbook by Simon Bailey

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

Running a simple test using Jasmine

This book is focused on testing AngularJS with the behavior-driven development framework Jasmine. Jasmine is currently the framework used for testing the AngularJS code base. With the increased popularity of test runners and generators, the core basics of using Jasmine without these additional tools is sometimes overlooked. In this recipe, you will learn how to set up a basic specification, load an AngularJS module, instantiate a controller, and finally, run a spec testing a value on scope. The series of steps within this recipe are the basis for all your AngularJS tests using Jasmine. The general structure is as follows:

  • Injecting dependencies
  • Defining a context
  • Writing specs

To solidify your base of comprehension ...

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