mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Ignore comms heartbeat messages in comms test
This commit is contained in:
parent
863b85714d
commit
f0e9a0279f
@ -174,13 +174,16 @@ describe("comms", function() {
|
||||
});
|
||||
ws.on('message', function(data) {
|
||||
var msg = JSON.parse(data);
|
||||
msg.should.have.property('topic', 'foo');
|
||||
msg.should.have.property('data', 'bar');
|
||||
count++;
|
||||
if (count == 5) {
|
||||
clearInterval(interval);
|
||||
ws.close();
|
||||
done();
|
||||
// It is possible a heartbeat message may arrive - so ignore them
|
||||
if (msg.topic != "hb") {
|
||||
msg.should.have.property('topic', 'foo');
|
||||
msg.should.have.property('data', 'bar');
|
||||
count++;
|
||||
if (count == 5) {
|
||||
clearInterval(interval);
|
||||
ws.close();
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user