mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
Mirror of https://github.com/zotero/zotero.git
sinon.useFakeXMLHttpRequest() doesn't work in our case, but if
Zotero.HTTP.mock is set, Zotero.HTTP.request() will create new instances of
that object instead of the built-in XMLHttpRequest, so it can be set to
FakeXMLHttpRequest:
Zotero.HTTP.mock = sinon.FakeXMLHttpRequest;
var server = sinon.fakeServer.create();
server.autoRespond = true;
server.respondWith("GET", "/users/1",
[200, {"Content-Type": "application/json"}, '{"userID": 1}']);
var userInfo = yield getUser();
Zotero.HTTP.mock = null;
server.restore(); // probably not necessary
|
||
|---|---|---|
| chrome | ||
| components | ||
| defaults/preferences | ||
| resource | ||
| styles@188e5914c7 | ||
| test | ||
| translators@daa1a05939 | ||
| .gitmodules | ||
| .travis.yml | ||
| chrome.manifest | ||
| COPYING | ||
| install.rdf | ||
| README.md | ||
| update.rdf | ||
Zotero
Zotero is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.
For more information on how to use this source code, see the Zotero wiki.