Add missing mocks to speed up tests and clean up output

This commit is contained in:
James Allen
2017-06-08 16:43:27 +01:00
parent 7ecb4128de
commit 770b53f6af
6 changed files with 16 additions and 0 deletions
@@ -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 ->