How to properly unit test jQuery’s .ajax() promises using Jasmine and/or Sinon?

By J. Ky Marsh.

View original

Excerpt: I’ve got a fairly straightforward function which returns a jQuery .ajax() promise as such: CLAW.controls.validateLocation = function(val, $inputEl) { return $.ajax({ url: locationServi...