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 ...

Get Jasmine Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.