Skip to content

Commit

Permalink
Fix failing sandbox.resetBehavior()
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed May 26, 2017
1 parent be4e53b commit 0bf0a79
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/sinon/util/fake_server.js
Expand Up @@ -100,6 +100,9 @@ var fakeServer = {
this.xhr = fakeXhr.useFakeXMLHttpRequest();
server.requests = [];
server.requestCount = 0;
server.queue = [];
server.responses = [];


this.xhr.onCreate = function (xhrObj) {
xhrObj.unsafeHeadersEnabled = function () {
Expand Down Expand Up @@ -166,10 +169,6 @@ var fakeServer = {

handleRequest: function handleRequest(xhr) {
if (xhr.async) {
if (!this.queue) {
this.queue = [];
}

push.call(this.queue, xhr);
} else {
this.processRequest(xhr);
Expand Down Expand Up @@ -199,10 +198,6 @@ var fakeServer = {
return;
}

if (!this.responses) {
this.responses = [];
}

if (arguments.length === 1) {
body = method;
url = method = null;
Expand Down

0 comments on commit 0bf0a79

Please sign in to comment.