Summary

In this chapter, you learned how asynchronous tests can hurt the quick feedback loop you can get with unit testing. I showed how you can use either stubs or fakes to make your specs run quicker and with fewer dependencies.

We have seen two different ways in which you could test AJAX requests with a simple Jasmine stub and with the more advanced, fake implementation of the XMLHttpRequest.

You also got more familiar with spies and stubs and should be more comfortable using them in different scenarios.

In the next chapter, we are going to go further into the complexity of our application, and we will do an overall refactoring to transform it into a fully featured single-page application using the React.js library.

Get Jasmine JavaScript Testing - Second Edition 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.