Skip to content

Commit b09a54e

Browse files
author
Devendra
committed
fixing unit test
1 parent a819e25 commit b09a54e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web/tests/qunit-tests.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ test("set_uuid() should set uuid and new presence event should come with new uui
4444
expect(2);
4545
stop(2);
4646
var ch = channel + '-' + ++count;
47-
var uuid = pubnub.get_uuid();
47+
var uuid;
48+
var uuid2;
49+
var uuid1 = uuid = pubnub.get_uuid();
4850
pubnub.subscribe({ channel : ch,
4951
connect : function(response) {
5052
setTimeout(function() {
51-
uuid = "efgh"
53+
uuid2 = uuid = "efgh"
5254
pubnub.set_uuid(uuid);
5355
}, 3000);
5456
},
@@ -58,6 +60,7 @@ test("set_uuid() should set uuid and new presence event should come with new uui
5860
presence : function(response) {
5961
if (response.action == "join") {
6062
deepEqual(response.uuid, uuid);
63+
if (response.uuid === uuid2) pubnub.unsubscribe({channel : ch});
6164
start();
6265
}
6366
}

0 commit comments

Comments
 (0)