diff --git a/services/document-updater/test/unit/coffee/DocumentManager/DocumentManagerTests.coffee b/services/document-updater/test/unit/coffee/DocumentManager/DocumentManagerTests.coffee index d7cd18630a..c52bb4b30d 100644 --- a/services/document-updater/test/unit/coffee/DocumentManager/DocumentManagerTests.coffee +++ b/services/document-updater/test/unit/coffee/DocumentManager/DocumentManagerTests.coffee @@ -8,6 +8,7 @@ tk = require "timekeeper" describe "DocumentManager", -> beforeEach -> + tk.freeze(new Date()) @DocumentManager = SandboxedModule.require modulePath, requires: "./RedisManager": @RedisManager = {} "./ProjectHistoryRedisManager": @ProjectHistoryRedisManager = {} @@ -35,6 +36,9 @@ describe "DocumentManager", -> @pathname = '/a/b/c.tex' @unflushedTime = Date.now() + afterEach -> + tk.reset() + describe "flushAndDeleteDoc", -> describe "successfully", -> beforeEach -> @@ -394,12 +398,8 @@ describe "DocumentManager", -> describe "getDocAndFlushIfOld", -> beforeEach -> - tk.freeze(new Date()) @DocumentManager.flushDocIfLoaded = sinon.stub().callsArg(2) - afterEach -> - tk.reset() - describe "when the doc is in Redis", -> describe "and has changes to be flushed", -> beforeEach -> diff --git a/services/document-updater/test/unit/coffee/ProjectHistoryRedisManager/ProjectHistoryRedisManagerTests.coffee b/services/document-updater/test/unit/coffee/ProjectHistoryRedisManager/ProjectHistoryRedisManagerTests.coffee index 349d3623e6..aa777b40d6 100644 --- a/services/document-updater/test/unit/coffee/ProjectHistoryRedisManager/ProjectHistoryRedisManagerTests.coffee +++ b/services/document-updater/test/unit/coffee/ProjectHistoryRedisManager/ProjectHistoryRedisManagerTests.coffee @@ -26,8 +26,8 @@ describe "ProjectHistoryRedisManager", -> globals: JSON: @JSON = JSON - afterEach -> - tk.reset() + afterEach -> + tk.reset() describe "queueOps", -> beforeEach -> diff --git a/services/document-updater/test/unit/coffee/RedisManager/RedisManagerTests.coffee b/services/document-updater/test/unit/coffee/RedisManager/RedisManagerTests.coffee index 42d06d743a..4f6c24720e 100644 --- a/services/document-updater/test/unit/coffee/RedisManager/RedisManagerTests.coffee +++ b/services/document-updater/test/unit/coffee/RedisManager/RedisManagerTests.coffee @@ -55,14 +55,14 @@ describe "RedisManager", -> globals: JSON: @JSON = JSON - afterEach -> - tk.reset() - @doc_id = "doc-id-123" @project_id = "project-id-123" @projectHistoryId = 123 @callback = sinon.stub() + afterEach -> + tk.reset() + describe "getDoc", -> beforeEach -> @lines = ["one", "two", "three", "これは"] # include some utf8