assaf/zombie — pull request #681 by lucidstack (2014-05-09 15:07:52+00:00)
Title: add raise method to xhr to catch errors in handlers

While writing integration tests with zombie, we've noticed that the existence of thrown errors in XMLHttpRequest response handlers cause zombie's dependency jsdom to call the method raise on the XMLHttpRequest object, which is, as of now, missing.

Apparently, a commit from more than two years ago in the jsdom repo broke zombie's correct behavior: https://github.com/tmpvar/jsdom/commit/95cefe9d374d99080fd0a15481fc25214eb51bc3#commitcomment-730325.

Adding a simple instance raise method in xhr.coffee permits the jsdom call to be correctly forwarded, and the error to bubble up to the test itself, where it can be used in assertions.