Просмотр исходного кода

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
Henry Oswald 7 лет назад
Родитель
Сommit
2c9b222437

+ 7 - 2
services/real-time/test/acceptance/coffee/ApplyUpdateTests.coffee

@@ -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

+ 3 - 2
services/real-time/test/acceptance/coffee/SessionTests.coffee

@@ -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", () ->