I've been trying this morning sinon fakeXMLHttpRequest and works pretty well