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 sample code.
Remember that in our previous example, we focused only on configuring the application to perform the test with Karma and Karma Runner.
Before we start writing our code, it's important to remember that the directives are used to manipulate...