mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
They seem to be succeeding when run individually, but failing when run as a whole. Not sure why yet.
23 lines
654 B
JavaScript
23 lines
654 B
JavaScript
"use strict";
|
|
|
|
describe("Zotero.Sync.Storage.Request", function () {
|
|
describe("#run()", function () {
|
|
it("should run a request and wait for it to complete", async function () {
|
|
var libraryID = Zotero.Libraries.userLibraryID;
|
|
var count = 0;
|
|
var item = await importFileAttachment('test.png');
|
|
var request = new Zotero.Sync.Storage.Request({
|
|
type: 'download',
|
|
libraryID,
|
|
name: `${item.libraryID}/${item.key}`,
|
|
onStart: async function () {
|
|
await Zotero.Promise.delay(25);
|
|
count++;
|
|
return new Zotero.Sync.Storage.Result;
|
|
}
|
|
});
|
|
var results = await request.start();
|
|
assert.equal(count, 1);
|
|
})
|
|
})
|
|
})
|