diff --git a/lib/mock-ajax.js b/lib/mock-ajax.js index 4d69321..28c2c8d 100644 --- a/lib/mock-ajax.js +++ b/lib/mock-ajax.js @@ -204,10 +204,18 @@ getJasmineRequireObj().AjaxFakeRequest = function() { self = this; this.events[event] = function() { - callback.apply(self); + callback.apply(self, [{}]); existingCallback(); }; }, + + removeEventListener: function(event, callback) { + var existingCallback = this.events[event]; + + if(existingCallback){ + delete this.events[event]; + } + }, status: null, diff --git a/src/fakeRequest.js b/src/fakeRequest.js index 4695f28..b8b0f59 100644 --- a/src/fakeRequest.js +++ b/src/fakeRequest.js @@ -159,10 +159,18 @@ getJasmineRequireObj().AjaxFakeRequest = function() { self = this; this.events[event] = function() { - callback.apply(self); + callback.apply(self, [{}]); existingCallback(); }; }, + + removeEventListener: function(event, callback) { + var existingCallback = this.events[event]; + + if(existingCallback){ + delete this.events[event]; + } + }, status: null,