This course has been updated! We now recommend you take the JavaScript Testing Practices and Principles course.

Check out a free preview of the full Unit Testing JavaScript (with CoffeeScript) course:
The "Video 2: AJAX Spies" Lesson is part of the full, Unit Testing JavaScript (with CoffeeScript) course featured in this preview video. Here's what you'd learn in this lesson:

Dave and Justin explain how to write a unit test for a UI element that triggers an AJAX request. This example also demonstrates nested unit tests. A key takeaway is that Given statements will always execute before When and Then statements.

Get Unlimited Access Now