mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
Merge pull request #32 from sharelatex/hof-fix-tk-in-tests
move tk call to before sandboxed module call
This commit is contained in:
commit
a5a2efd3b3
3 changed files with 9 additions and 9 deletions
|
@ -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 ->
|
||||
|
|
|
@ -26,8 +26,8 @@ describe "ProjectHistoryRedisManager", ->
|
|||
globals:
|
||||
JSON: @JSON = JSON
|
||||
|
||||
afterEach ->
|
||||
tk.reset()
|
||||
afterEach ->
|
||||
tk.reset()
|
||||
|
||||
describe "queueOps", ->
|
||||
beforeEach ->
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue