www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 7a839e19a67180abbd019f58b818720607ef9cba
parent b30e168c2146ce4d5243b377303aa9ff26d469be
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri,  5 May 2017 00:26:43 -0400

Fix background/stopOnError options for sync engine tests

Diffstat:
Mtest/tests/syncEngineTest.js | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/test/tests/syncEngineTest.js b/test/tests/syncEngineTest.js @@ -12,24 +12,26 @@ describe("Zotero.Sync.Data.Engine", function () { var setup = Zotero.Promise.coroutine(function* (options = {}) { server = sinon.fakeServer.create(); server.autoRespond = true; + var background = options.background === undefined ? true : options.background; + var stopOnError = options.stopOnError === undefined ? true : options.stopOnError; Components.utils.import("resource://zotero/concurrentCaller.js"); var caller = new ConcurrentCaller(1); caller.setLogger(msg => Zotero.debug(msg)); - caller.stopOnError = true; + caller.stopOnError = stopOnError; var client = new Zotero.Sync.APIClient({ baseURL, apiVersion: options.apiVersion || ZOTERO_CONFIG.API_VERSION, apiKey, caller, - background: options.background || true + background }); var engine = new Zotero.Sync.Data.Engine({ apiClient: client, libraryID: options.libraryID || Zotero.Libraries.userLibraryID, - stopOnError: true + stopOnError }); return { engine, client, caller }; @@ -1170,8 +1172,9 @@ describe("Zotero.Sync.Data.Engine", function () { }) it("should ignore errors when saving downloaded objects", function* () { - ({ engine, client, caller } = yield setup()); - engine.stopOnError = false; + ({ engine, client, caller } = yield setup({ + stopOnError: false + })); var headers = { "Last-Modified-Version": 3