Writing Jasmine specs for AJAX

Using AJAX, we can load data in the background and display it on the web page without reloading the whole page. Whenever an AJAX request is initiated, it creates an XMLHttpRequest object and sends an HttpRequest request to the server. The server processes the request and sends the response back to the browser. In other words, AJAX allows web applications to send/retrieve data to/from a server asynchronously without interfering with the display and behavior of the existing page. It is hard to test asynchronous processes. However, the Jasmine library provides a couple of tools for handling AJAX calls. In this recipe, you will learn how to write Jasmine specs for AJAX calls.

Getting ready

Now, to write Jasmine specs for ...

Get Jasmine Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.