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

Writing tests for directives with Jasmine

As we commented in the previous chapter, we use the Jasmine framework for writing tests. Let's take a look at what the official documentation says about Jasmine.

Tip

Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require the DOM. And it has a clean, obvious syntax so that you can easily write tests.

Getting ready

For the next recipe we use a code base that was previously created in Chapter 8, Creating Reusable Directives, which charts the directive with some minor changes.

You can download the code from the Chapter 8 folder directly from the Packt Publishing website, or by following the steps using this chapter's ...

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