Skip to content

Commit

Permalink
Relax last-sync-time check in sync runner test
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Jun 6, 2017
1 parent dcb3d74 commit cd6079d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/tests/syncRunnerTest.js
Expand Up @@ -836,6 +836,8 @@ describe("Zotero.Sync.Runner", function () {
json: {}
});

var startTime = new Date().getTime();

yield runner.sync({
onError: e => { throw e },
});
Expand All @@ -854,9 +856,9 @@ describe("Zotero.Sync.Runner", function () {
20
);

// Last sync time should be within the last second
// Last sync time should be within the last few seconds
var lastSyncTime = Zotero.Sync.Data.Local.getLastSyncTime();
assert.isAbove(lastSyncTime.getTime(), new Date().getTime() - 2000);
assert.isAbove(lastSyncTime.getTime(), startTime);
assert.isBelow(lastSyncTime.getTime(), new Date().getTime());
})

Expand Down

0 comments on commit cd6079d

Please sign in to comment.