mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-08 18:51:12 +02:00
20 lines
428 B
JavaScript
20 lines
428 B
JavaScript
beforeEach(function() {
|
|
|
|
if (typeof jQuery != 'undefined') {
|
|
spyOn(jQuery.ajaxSettings, 'xhr', true).andCallFake(function() {
|
|
var newXhr = new FakeXMLHttpRequest();
|
|
ajaxRequests.push(newXhr);
|
|
return newXhr;
|
|
});
|
|
}
|
|
|
|
if (typeof Prototype != 'undefined') {
|
|
spyOn(Ajax, "getTransport", true).andCallFake(function() {
|
|
return new FakeXMLHttpRequest();
|
|
});
|
|
}
|
|
|
|
clearAjaxRequests();
|
|
|
|
});
|