Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 3d08d14

Browse files
author
Eric Andrews
committed
fix indentation
1 parent 7994b21 commit 3d08d14

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

test/test.streamr-client.js

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ describe('StreamrClient', function() {
400400
sub._ack = true
401401
if (sub1._ack && sub2._ack)
402402
done()
403-
}
403+
}
404404

405405
sub1.on('subscribed', function(response) {
406406
check(sub1)
@@ -563,7 +563,7 @@ describe('StreamrClient', function() {
563563
socket.fakeReceive([0, broadcastCode, null, msg("stream1", 0)])
564564
})
565565
})
566-
566+
567567
it('should call the callback once for each message in order', function(done) {
568568
var receivedCounts = []
569569
client.subscribe("stream1", function(message) {
@@ -574,7 +574,7 @@ describe('StreamrClient', function() {
574574
}
575575
})
576576
client.connect()
577-
577+
578578
client.connection.once('subscribed', function() {
579579
const broadcastCode = 0
580580
socket.fakeReceive([0, broadcastCode, null, msg("stream1", 0, { count: 0 })])
@@ -760,11 +760,11 @@ describe('StreamrClient', function() {
760760
throw "This message handler should not be called"
761761
})
762762
client.connect()
763-
763+
764764
sub.on('subscribed', function() {
765765
client.unsubscribe(sub)
766766
})
767-
767+
768768
sub.on('unsubscribed', function() {
769769
var newSub = client.subscribe("stream1", function(message) {
770770
assert.deepEqual(message, { count: 0})
@@ -843,7 +843,7 @@ describe('StreamrClient', function() {
843843
})
844844
})
845845
})
846-
846+
847847
describe("disconnect", function() {
848848

849849
it('should disconnect the socket', function(done) {
@@ -943,12 +943,12 @@ describe('StreamrClient', function() {
943943

944944
it('should subscribe to both old and new subscriptions after pause-and-connect', function(done) {
945945
var sub1, sub2
946-
946+
947947
sub1 = client.subscribe("stream1", function(message) {})
948948
client.connect()
949-
949+
950950
client.connection.once('subscribed', function() {
951-
client.pause()
951+
client.pause()
952952
})
953953

954954
client.connection.once('disconnected', function() {
@@ -970,11 +970,11 @@ describe('StreamrClient', function() {
970970
})
971971
})
972972
})
973-
973+
974974
describe("resend", function() {
975975
var validResendRequests
976976
var resendLimits
977-
977+
978978
function checkResendRequest(request) {
979979
var el = validResendRequests[0]
980980
// all fields in the model request must be equal in actual request
@@ -985,7 +985,7 @@ describe('StreamrClient', function() {
985985
})
986986
validResendRequests.shift()
987987
}
988-
988+
989989
// Setup a resend response mock
990990
beforeEach(function() {
991991
validResendRequests = []
@@ -1081,7 +1081,7 @@ describe('StreamrClient', function() {
10811081

10821082
client.connection.once('resent', function() {
10831083
done()
1084-
})
1084+
})
10851085
})
10861086

10871087
it('should recognize the resend_from_time option', function(done) {
@@ -1094,7 +1094,7 @@ describe('StreamrClient', function() {
10941094

10951095
client.connection.once('resent', function() {
10961096
done()
1097-
})
1097+
})
10981098
})
10991099

11001100
it('should recognize the resend_from_time option given as a Date object', function(done) {
@@ -1106,7 +1106,7 @@ describe('StreamrClient', function() {
11061106

11071107
client.connection.once('resent', function() {
11081108
done()
1109-
})
1109+
})
11101110
})
11111111

11121112
it('should throw if resend_from_time is in invalid format', function() {
@@ -1205,7 +1205,7 @@ describe('StreamrClient', function() {
12051205
done()
12061206
})
12071207
})
1208-
1208+
12091209
it('should not emit another resend request while waiting for resend', function(done) {
12101210
validResendRequests.push({ channel: "stream1", resend_from: 1, resend_to: 9})
12111211

@@ -1225,13 +1225,13 @@ describe('StreamrClient', function() {
12251225
++counter
12261226
defaultResendHandler(request)
12271227
}
1228-
1228+
12291229
client.connection.once('resent', function() {
12301230
assert.equal(counter, 1)
12311231
done()
12321232
})
12331233
})
1234-
1234+
12351235
it('should process queued messages when the resend is complete', function(done) {
12361236
validResendRequests.push({ channel: "stream1", resend_from: 1, resend_to: 9 })
12371237

@@ -1250,7 +1250,7 @@ describe('StreamrClient', function() {
12501250
socket.fakeReceive([0, broadcastCode, null, msg('stream1', 12, { counter: 12 })])
12511251
})
12521252
})
1253-
1253+
12541254
it('should ignore retransmissions in the queue', function(done) {
12551255
validResendRequests.push({ channel: "stream1", resend_from: 1, resend_to: 9 })
12561256

@@ -1271,7 +1271,7 @@ describe('StreamrClient', function() {
12711271
socket.fakeReceive([0, broadcastCode, null, msg('stream1', 12, { counter: 12 }, undefined, 11)])
12721272
})
12731273
})
1274-
1274+
12751275
it('should do another resend request if there are gaps in the queue', function(done) {
12761276
validResendRequests.push({ channel: "stream1", resend_from: 1, resend_to: 9 })
12771277
validResendRequests.push({ channel: "stream1", resend_from: 11, resend_to: 11 })
@@ -1282,7 +1282,7 @@ describe('StreamrClient', function() {
12821282
}
12831283
})
12841284
client.connect()
1285-
1285+
12861286
client.connection.once('subscribed', function() {
12871287
const broadcastCode = 0
12881288
socket.fakeReceive([0, broadcastCode, null, msg('stream1', 0, { counter: 0 })])
@@ -1376,17 +1376,17 @@ describe('StreamrClient', function() {
13761376
client.connect()
13771377

13781378
client.connection.on('subscribed', function(response) {
1379-
socket.disconnect()
1379+
socket.disconnect()
13801380
})
13811381

13821382
client.connection.once('disconnected', function() {
1383-
socket.resendHandler = function (request) {
1384-
assert.equal(request.resend_last, 1)
1385-
assert.equal(msgHandler.callCount, 1)
1386-
socket.done = true
1387-
done()
1388-
}
1389-
socket.connect()
1383+
socket.resendHandler = function (request) {
1384+
assert.equal(request.resend_last, 1)
1385+
assert.equal(msgHandler.callCount, 1)
1386+
socket.done = true
1387+
done()
1388+
}
1389+
socket.connect()
13901390
})
13911391
})
13921392

@@ -1398,26 +1398,26 @@ describe('StreamrClient', function() {
13981398
client.connect()
13991399

14001400
client.connection.on('subscribed', function(response) {
1401-
socket.disconnect()
1401+
socket.disconnect()
14021402
})
14031403

14041404
client.connection.once('disconnected', function() {
1405-
socket.resendHandler = function (request) {
1406-
assert.equal(request.resend_last, 1)
1407-
1408-
const unicastCode = 1
1409-
const resendingCode = 4
1410-
const resentCode = 5
1411-
1412-
socket.fakeReceive([0, resendingCode, null, { channel: request.channel, sub: request.sub }])
1413-
socket.fakeReceive([0, unicastCode, request.sub, msg(request.channel, 10, {}, request.sub, 9)])
1414-
socket.fakeReceive([0, resentCode, null, { channel: request.channel, sub: request.sub }])
1415-
1416-
assert.equal(msgHandler.callCount, 2)
1417-
socket.done = true
1418-
done()
1419-
}
1420-
socket.connect()
1405+
socket.resendHandler = function (request) {
1406+
assert.equal(request.resend_last, 1)
1407+
1408+
const unicastCode = 1
1409+
const resendingCode = 4
1410+
const resentCode = 5
1411+
1412+
socket.fakeReceive([0, resendingCode, null, { channel: request.channel, sub: request.sub }])
1413+
socket.fakeReceive([0, unicastCode, request.sub, msg(request.channel, 10, {}, request.sub, 9)])
1414+
socket.fakeReceive([0, resentCode, null, { channel: request.channel, sub: request.sub }])
1415+
1416+
assert.equal(msgHandler.callCount, 2)
1417+
socket.done = true
1418+
done()
1419+
}
1420+
socket.connect()
14211421
})
14221422
})
14231423
})

0 commit comments

Comments
 (0)