I have a question concerning Sinon testing. I am using mochacasper and I want to catch the XMLHttpRequest that is sent after I click a button. So far I am not able to catch the request...
casper.then(function () {
this.fill(...);
});
casper.then(function() {
this.click('#myButton');
});
casper.then(function () {
//I want to catch the request/response here
});
Since I am using my testing environment database, I know that my request is sent, because my test data is added to my database.
I have tried sinon's useFakeXMLHttpRequest
, as well as sinon's fakeServer
, but none is working.
So how can I catch the request?