April 2015
Intermediate to advanced
276 pages
5h 38m
English
In the first recipe, we looked at how to write Jasmine specs for AJAX calls using the jasmine-ajax plugin. In this recipe, you will learn how to write tests for jQuery and DOM manipulation in Jasmine specs.
To understand how to write Jasmine specs with jQuery, let's create the myfixture.html file and consider the following code:
<!DOCTYPE html> <html> <body> <div id="my-fixture">something</div> </body> </html>
Here, we simply created HTML file with a div tag and defined id as my-fixture.
Next, let's create the jQuery_example.js file and consider the following code:
function sendRequestWithJQuery(myCallback,showErrorMessage,configurationData) { $.ajax({ url: configurationData.url, dataType: "json", success: ...Read now
Unlock full access