O'Reilly logo

Jasmine Cookbook by Munish Sethi

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

Designing Jasmine specs with HTML and JSON fixtures

In this recipe, you will learn how to write Jasmine specs for JSON and HTML fixtures with the help of the jasmine-jquery plugin. It provides two extensions for the Jasmine JavaScript Testing Framework:

  • An API for handling HTML and JSON fixtures in your specs
  • A set of custom matchers for jQuery framework

The scope of this recipe is to design specs using HTML and JSON fixtures. For information on custom jQuery matchers, refer to the Writing Jasmine specs using custom jQuery matchers recipe.

To understand this recipe, let's assume that you are developing a JavaScript application and you have to develop test code for various scenarios using HTML and JSON fixtures.

"As a JavaScript developer, I want to ...

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