mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +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();
|
|
|
|
});
|