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