mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 06:13:34 -05:00
fix breaking tests from using ioredis with inbuilt promises
because a promise is returned from ioredis it errors in mocha as it can't take a promise and a callback
This commit is contained in:
parent
47e0cb44ce
commit
2c9b222437
2 changed files with 10 additions and 4 deletions
|
@ -48,6 +48,7 @@ describe "applyOtUpdate", ->
|
|||
rclient.lrange "pending-updates-list", 0, -1, (error, [doc_id]) =>
|
||||
doc_id.should.equal "#{@project_id}:#{@doc_id}"
|
||||
done()
|
||||
return null
|
||||
|
||||
it "should push the update into redis", (done) ->
|
||||
rclient.lrange redisSettings.documentupdater.key_schema.pendingUpdates({@doc_id}), 0, -1, (error, [update]) =>
|
||||
|
@ -58,7 +59,8 @@ describe "applyOtUpdate", ->
|
|||
user_id: @user_id
|
||||
}
|
||||
done()
|
||||
|
||||
return null
|
||||
|
||||
after (done) ->
|
||||
async.series [
|
||||
(cb) => rclient.del "pending-updates-list", cb
|
||||
|
@ -107,6 +109,7 @@ describe "applyOtUpdate", ->
|
|||
rclient.llen redisSettings.documentupdater.key_schema.pendingUpdates({@doc_id}), (error, len) =>
|
||||
len.should.equal 0
|
||||
done()
|
||||
return null
|
||||
|
||||
describe "when authorized to read-only with a comment update", ->
|
||||
before (done) ->
|
||||
|
@ -142,6 +145,7 @@ describe "applyOtUpdate", ->
|
|||
rclient.lrange "pending-updates-list", 0, -1, (error, [doc_id]) =>
|
||||
doc_id.should.equal "#{@project_id}:#{@doc_id}"
|
||||
done()
|
||||
return null
|
||||
|
||||
it "should push the update into redis", (done) ->
|
||||
rclient.lrange redisSettings.documentupdater.key_schema.pendingUpdates({@doc_id}), 0, -1, (error, [update]) =>
|
||||
|
@ -152,7 +156,8 @@ describe "applyOtUpdate", ->
|
|||
user_id: @user_id
|
||||
}
|
||||
done()
|
||||
|
||||
return null
|
||||
|
||||
after (done) ->
|
||||
async.series [
|
||||
(cb) => rclient.del "pending-updates-list", cb
|
||||
|
|
|
@ -12,8 +12,9 @@ describe "Session", ->
|
|||
}, (error) =>
|
||||
throw error if error?
|
||||
@client = RealTimeClient.connect()
|
||||
done()
|
||||
|
||||
return done()
|
||||
return null
|
||||
|
||||
it "should not get disconnected", (done) ->
|
||||
disconnected = false
|
||||
@client.on "disconnect", () ->
|
||||
|
|
Loading…
Reference in a new issue