mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Add missing mocks to speed up tests and clean up output
This commit is contained in:
@@ -13,6 +13,7 @@ describe "DispatchManager", ->
|
||||
redis:
|
||||
realtime: {}
|
||||
"redis-sharelatex": @redis = {}
|
||||
"./RateLimitManager": {}
|
||||
@callback = sinon.stub()
|
||||
@RateLimiter = { run: (task,cb) -> task(cb) } # run task without rate limit
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ describe 'LockManager - checking the lock', ()->
|
||||
auth:->
|
||||
exists: existsStub
|
||||
"./Metrics": {inc: () ->}
|
||||
"./Profiler": class Profiler
|
||||
log: sinon.stub().returns { end: sinon.stub() }
|
||||
end: sinon.stub()
|
||||
LockManager = SandboxedModule.require(modulePath, requires: mocks)
|
||||
|
||||
it 'should return true if the key does not exists', (done)->
|
||||
|
||||
@@ -26,6 +26,9 @@ describe 'LockManager - releasing the lock', ()->
|
||||
blockingKey: ({doc_id}) -> "Blocking:#{doc_id}"
|
||||
}
|
||||
"./Metrics": {inc: () ->}
|
||||
"./Profiler": class Profiler
|
||||
log: sinon.stub().returns { end: sinon.stub() }
|
||||
end: sinon.stub()
|
||||
@LockManager = SandboxedModule.require(modulePath, requires: mocks)
|
||||
@lockValue = "lock-value-stub"
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ describe 'LockManager - getting the lock', ->
|
||||
createClient : () =>
|
||||
auth:->
|
||||
"./Metrics": {inc: () ->}
|
||||
"./Profiler": class Profiler
|
||||
log: sinon.stub().returns { end: sinon.stub() }
|
||||
end: sinon.stub()
|
||||
@callback = sinon.stub()
|
||||
@doc_id = "doc-id-123"
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ describe 'LockManager - trying the lock', ->
|
||||
key_schema:
|
||||
blockingKey: ({doc_id}) -> "Blocking:#{doc_id}"
|
||||
}
|
||||
"./Profiler": class Profiler
|
||||
log: sinon.stub().returns { end: sinon.stub() }
|
||||
end: sinon.stub()
|
||||
|
||||
@callback = sinon.stub()
|
||||
@doc_id = "doc-id-123"
|
||||
|
||||
@@ -22,6 +22,9 @@ describe "UpdateManager", ->
|
||||
"settings-sharelatex": Settings = {}
|
||||
"./DocumentManager": @DocumentManager = {}
|
||||
"./RangesManager": @RangesManager = {}
|
||||
"./Profiler": class Profiler
|
||||
log: sinon.stub().returns { end: sinon.stub() }
|
||||
end: sinon.stub()
|
||||
|
||||
describe "processOutstandingUpdates", ->
|
||||
beforeEach ->
|
||||
|
||||
Reference in New Issue
Block a user