Main Content

Prototyping and Unit Testing with Mockjax & mockJSON

About the Talk

April 16, 2011 1:15 PM

Microsoft, Mt. View, California

Microsoft, Mt. View, California

The front-end and back-end of your application inevitably progress at different speeds. In order for each layer to develop independently it is optimal if the front-end piece can work regardless of the back-end, which is where the Mockjax plugin comes in. Mockjax can intercept and simulate ajax requests made with jQuery with minimal effort and impact to your code. Another tool that works well with Mockjax is mockJSON which provides a random data templating feature. This can be very handy when you want to mock a JSON response from a AJAX call, but instead of manually building the response you can build a template to do it for you.

As you are developing, Mockjax can also be used to help Unit Test your front-end code. You can setup a static mock responses to your requests and then Unit Test your Ajax success and fail event handlers.

Ratings and Recommendations

Avg. Rating

Average based
on 6 ratings

comments powered by Disqus