<commit_before>"use strict";

describe("Zotero.Sync.Storage.Request", function () {
	describe("#run()", function () {
		it("should run a request and wait for it to complete", function* () {
			var libraryID = Zotero.Libraries.userLibraryID;
			var count = 0;
			var request = new Zotero.Sync.Storage.Request({
				type: 'download',
				libraryID,
				name: "1/AAAAAAAA",
				onStart: Zotero.Promise.coroutine(function* () {
					yield Zotero.Promise.delay(25);
					count++;
					return new Zotero.Sync.Storage.Result;
				})
			});
			var results = yield request.start();
			assert.equal(count, 1);
		})
	})
})<commit_msg>Avoid a warning from a storageRequest test from the item not existing<commit_after>"use strict";

describe("Zotero.Sync.Storage.Request", function () {
	describe("#run()", function () {
		it("should run a request and wait for it to complete", function* () {
			var libraryID = Zotero.Libraries.userLibraryID;
			var count = 0;
			var item = yield importFileAttachment('test.png');
			var request = new Zotero.Sync.Storage.Request({
				type: 'download',
				libraryID,
				name: `${item.libraryID}/${item.key}`,
				onStart: Zotero.Promise.coroutine(function* () {
					yield Zotero.Promise.delay(25);
					count++;
					return new Zotero.Sync.Storage.Result;
				})
			});
			var results = yield request.start();
			assert.equal(count, 1);
		})
	})
})
{'fraction_non_alphanumeric': 0.152, 'fraction_numerical': 0.006545454545454545, 'mean_word_length': 3.541254125412541, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2625911', 'n_tokens_mistral': 533, 'n_tokens_neox': 440, 'n_words': 107}