From 7a839e19a67180abbd019f58b818720607ef9cba Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 5 May 2017 00:26:43 -0400 Subject: [PATCH] Fix background/stopOnError options for sync engine tests --- test/tests/syncEngineTest.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/tests/syncEngineTest.js b/test/tests/syncEngineTest.js index 08081b94c..48719f5ad 100644 --- 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