You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug sinon.useFakeXMLHttpRequest() replaces global XMLHttpRequest object, but it doesn't restore it when sinon.restore() is called. The problem is that sinon object overrides useFakeXMLHttpRequest method instead of using the one from Sandbox class and the fake is not added to the collection that is being restored when sinon.restore() is called.
To Reproduce
it("should restore XMLHttpRequest and ActiveXObject", function () {
var globalXHR = global.XMLHttpRequest;
var globalAXO = global.ActiveXObject;
sinon.useFakeXMLHttpRequest();
sinon.restore();
assert.same(global.XMLHttpRequest, globalXHR);
assert.same(global.ActiveXObject, globalAXO);
});
Expected behavior
The test above should pass.
Context (please complete the following information):
Library version: 6.0.0
Environment: OSX, node 8.10.0
The text was updated successfully, but these errors were encountered:
Describe the bug
sinon.useFakeXMLHttpRequest()
replaces global XMLHttpRequest object, but it doesn't restore it whensinon.restore()
is called. The problem is that sinon object overrides useFakeXMLHttpRequest method instead of using the one from Sandbox class and the fake is not added to the collection that is being restored whensinon.restore()
is called.To Reproduce
Expected behavior
The test above should pass.
Context (please complete the following information):
The text was updated successfully, but these errors were encountered: