February 2015
Intermediate to advanced
232 pages
4h 40m
English
Mocking
data just means replacing the $.ajax calls with another function that emulates its behavior. Mocking is a commonly-used technique when following a test-driven development paradigm.
To mock jQuery AJAX calls, we are going to use a library called Mockjax. To install Mockjax in the application, follow these steps:
vendors folder.index.html page, just after the jQuery library. To do this, use the <script> tag, as shown here:<script type='text/javascript' src='vendors/jquery.mockjax.js'></script>
mocks and create a product.js file inside it.product.js file, define a mock ...Read now
Unlock full access