mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fixed tests
This commit is contained in:
parent
672dd3de1b
commit
d7894c4ea7
17 changed files with 17 additions and 17 deletions
|
@ -22,7 +22,7 @@ describe 'putting a doc into memory', ()->
|
||||||
|
|
||||||
mocks =
|
mocks =
|
||||||
"logger-sharelatex": log:->
|
"logger-sharelatex": log:->
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient : ()->
|
createClient : ()->
|
||||||
auth:->
|
auth:->
|
||||||
multi: ()->
|
multi: ()->
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe 'Document Manager - getUpdatesLength ', ->
|
||||||
|
|
||||||
@llenStub = sinon.stub()
|
@llenStub = sinon.stub()
|
||||||
@redisManager = SandboxedModule.require modulePath, requires:
|
@redisManager = SandboxedModule.require modulePath, requires:
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient:=>
|
createClient:=>
|
||||||
auth:->
|
auth:->
|
||||||
llen:@llenStub
|
llen:@llenStub
|
||||||
|
|
|
@ -12,7 +12,7 @@ describe "DispatchManager", ->
|
||||||
"settings-sharelatex": @settings =
|
"settings-sharelatex": @settings =
|
||||||
redis:
|
redis:
|
||||||
web: {}
|
web: {}
|
||||||
"redis": @redis = {}
|
"redis-sharelatex": @redis = {}
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
|
|
||||||
describe "each worker", ->
|
describe "each worker", ->
|
||||||
|
|
|
@ -11,7 +11,7 @@ describe 'RedisManager - getDoc', ->
|
||||||
@rclient.multi = () => @rclient
|
@rclient.multi = () => @rclient
|
||||||
|
|
||||||
@RedisManager = SandboxedModule.require modulePath, requires:
|
@RedisManager = SandboxedModule.require modulePath, requires:
|
||||||
"redis": @redis =
|
"redis-sharelatex": @redis =
|
||||||
createClient: () => @rclient
|
createClient: () => @rclient
|
||||||
|
|
||||||
@doc_id = "doc-id-123"
|
@doc_id = "doc-id-123"
|
||||||
|
|
|
@ -18,7 +18,7 @@ describe 'getting entire list of pending updates', ()->
|
||||||
redisReturn = []
|
redisReturn = []
|
||||||
|
|
||||||
mocks =
|
mocks =
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient: ()->
|
createClient: ()->
|
||||||
auth:->
|
auth:->
|
||||||
multi: ()->
|
multi: ()->
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe 'getting cound of docs from memory', ()->
|
||||||
beforeEach (done)->
|
beforeEach (done)->
|
||||||
mocks =
|
mocks =
|
||||||
"logger-sharelatex": log:->
|
"logger-sharelatex": log:->
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient : ()->
|
createClient : ()->
|
||||||
auth:->
|
auth:->
|
||||||
smembers:(key, callback)->
|
smembers:(key, callback)->
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe 'Lock Manager - checking the lock', ()->
|
||||||
mocks =
|
mocks =
|
||||||
"logger-sharelatex": log:->
|
"logger-sharelatex": log:->
|
||||||
|
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient : ()->
|
createClient : ()->
|
||||||
auth:->
|
auth:->
|
||||||
multi: ->
|
multi: ->
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe 'LockManager - releasing the lock', ()->
|
||||||
mocks =
|
mocks =
|
||||||
"logger-sharelatex": log:->
|
"logger-sharelatex": log:->
|
||||||
|
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient : ()->
|
createClient : ()->
|
||||||
auth:->
|
auth:->
|
||||||
del:deleteStub
|
del:deleteStub
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe 'LockManager - getting the lock', ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@LockManager = SandboxedModule.require modulePath, requires:
|
@LockManager = SandboxedModule.require modulePath, requires:
|
||||||
"logger-sharelatex": log:->
|
"logger-sharelatex": log:->
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient : () =>
|
createClient : () =>
|
||||||
auth:->
|
auth:->
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe 'LockManager - trying the lock', ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@LockManager = SandboxedModule.require modulePath, requires:
|
@LockManager = SandboxedModule.require modulePath, requires:
|
||||||
"logger-sharelatex": log:->
|
"logger-sharelatex": log:->
|
||||||
redis:
|
"redis-sharelatex":
|
||||||
createClient : () =>
|
createClient : () =>
|
||||||
auth:->
|
auth:->
|
||||||
set: @set = sinon.stub()
|
set: @set = sinon.stub()
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe "RedisManager.clearDocFromPendingUpdatesSet", ->
|
||||||
@doc_id = "document-id"
|
@doc_id = "document-id"
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
@RedisManager = SandboxedModule.require modulePath, requires:
|
@RedisManager = SandboxedModule.require modulePath, requires:
|
||||||
"redis" : createClient: () =>
|
"redis-sharelatex" : createClient: () =>
|
||||||
@rclient = auth:->
|
@rclient = auth:->
|
||||||
"logger-sharelatex": {}
|
"logger-sharelatex": {}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe "RedisManager.getDocsWithPendingUpdates", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
@RedisManager = SandboxedModule.require modulePath, requires:
|
@RedisManager = SandboxedModule.require modulePath, requires:
|
||||||
"redis" : createClient: () =>
|
"redis-sharelatex" : createClient: () =>
|
||||||
@rclient = auth:->
|
@rclient = auth:->
|
||||||
"logger-sharelatex": {}
|
"logger-sharelatex": {}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module')
|
||||||
describe "RedisManager.getPendingUpdatesForDoc", ->
|
describe "RedisManager.getPendingUpdatesForDoc", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@RedisManager = SandboxedModule.require modulePath, requires:
|
@RedisManager = SandboxedModule.require modulePath, requires:
|
||||||
"redis": createClient: () =>
|
"redis-sharelatex": createClient: () =>
|
||||||
@rclient =
|
@rclient =
|
||||||
auth: () ->
|
auth: () ->
|
||||||
multi: () => @rclient
|
multi: () => @rclient
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe "RedisManager.getPreviousDocOpsTests", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
@RedisManager = SandboxedModule.require modulePath, requires:
|
@RedisManager = SandboxedModule.require modulePath, requires:
|
||||||
"redis" : createClient: () =>
|
"redis-sharelatex" : createClient: () =>
|
||||||
@rclient =
|
@rclient =
|
||||||
auth: ->
|
auth: ->
|
||||||
multi: => @rclient
|
multi: => @rclient
|
||||||
|
|
|
@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module')
|
||||||
describe "RedisManager.pushDocOp", ->
|
describe "RedisManager.pushDocOp", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@RedisManager = SandboxedModule.require modulePath, requires:
|
@RedisManager = SandboxedModule.require modulePath, requires:
|
||||||
"redis": createClient: () =>
|
"redis-sharelatex": createClient: () =>
|
||||||
@rclient =
|
@rclient =
|
||||||
auth: () ->
|
auth: () ->
|
||||||
multi: () => @rclient
|
multi: () => @rclient
|
||||||
|
|
|
@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module')
|
||||||
describe "RedisManager.pushUncompressedHistoryOp", ->
|
describe "RedisManager.pushUncompressedHistoryOp", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@RedisManager = SandboxedModule.require modulePath, requires:
|
@RedisManager = SandboxedModule.require modulePath, requires:
|
||||||
"redis": createClient: () =>
|
"redis-sharelatex": createClient: () =>
|
||||||
@rclient =
|
@rclient =
|
||||||
auth: () ->
|
auth: () ->
|
||||||
multi: () => @rclient
|
multi: () => @rclient
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe "ShareJsUpdateManager", ->
|
||||||
class Model
|
class Model
|
||||||
constructor: (@db) ->
|
constructor: (@db) ->
|
||||||
"./ShareJsDB" : @ShareJsDB = { mockDB: true }
|
"./ShareJsDB" : @ShareJsDB = { mockDB: true }
|
||||||
"redis" : createClient: () => @rclient = auth:->
|
"redis-sharelatex" : createClient: () => @rclient = auth:->
|
||||||
"logger-sharelatex": @logger = { log: sinon.stub() }
|
"logger-sharelatex": @logger = { log: sinon.stub() }
|
||||||
globals:
|
globals:
|
||||||
clearTimeout: @clearTimeout = sinon.stub()
|
clearTimeout: @clearTimeout = sinon.stub()
|
||||||
|
|
Loading…
Reference in a new issue