fix websocket feedback test - now doesn't spin

This commit is contained in:
Dave Conway-Jones
2018-09-26 16:03:22 +01:00
parent 1a7868159a
commit c9dc9b4fe9
2 changed files with 10 additions and 7 deletions

View File

@@ -481,7 +481,7 @@ describe('websocket Node', function() {
});
});
it('should feedback', function(done) {
it('should NOT feedback more than once', function(done) {
var flow = [
{ id: "server", type: "websocket-listener", path: "/ws", wholemsg: "true" },
{ id: "client", type: "websocket-client", path: getWsUrl("/ws"), wholemsg: "true" },
@@ -497,11 +497,13 @@ describe('websocket Node', function() {
});
var acc = 0;
helper.getNode("output").on("input", function(msg) {
if (acc++ > 20) {
helper.clearFlows();
done();
}
acc = acc + 1;
});
setTimeout( function() {
acc.should.equal(1);
helper.clearFlows();
done();
}, 250);
});
});
});