Fixup websocket tests as we now need a client

only-connect-websocket-client-if-need-to
Dave Conway-Jones 2026-03-06 15:38:48 +00:00
parent 4349b58dc5
commit 62bd0fc0eb
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643
1 changed files with 7 additions and 3 deletions

View File

@ -381,7 +381,9 @@ describe('websocket Node', function() {
it('should connect to server', function(done) {
var flow = [
{ id: "server", type: "websocket-listener", path: "/ws" },
{ id: "n2", type: "websocket-client", path: getWsUrl("/ws") }];
{ id: "n2", type: "websocket-client", path: getWsUrl("/ws") },
{ id: "n3", type: "websocket out", client: "n2" }
];
helper.load(websocketNode, flow, function() {
getSocket('server').on('connection', function(sock) {
done();
@ -393,7 +395,8 @@ describe('websocket Node', function() {
it('should initiate with subprotocol', function(done) {
var flow = [
{ id: "server", type: "websocket-listener", path: "/ws" },
{ id: "n2", type: "websocket-client", path: getWsUrl("/ws"), subprotocol: "testprotocol" }];
{ id: "n2", type: "websocket-client", path: getWsUrl("/ws"), subprotocol: "testprotocol" },
{ id: "n3", type: "websocket out", client: "n2" }];
helper.load(websocketNode, flow, function() {
getSocket('server').on('connection', function (sock) {
sock.should.have.property("protocol", "testprotocol")
@ -405,7 +408,8 @@ describe('websocket Node', function() {
it('should close on delete', function(done) {
var flow = [
{ id: "server", type: "websocket-listener", path: "/ws" },
{ id: "n2", type: "websocket-client", path: getWsUrl("/ws") }];
{ id: "n2", type: "websocket-client", path: getWsUrl("/ws") },
{ id: "n3", type: "websocket out", client: "n2" }];
helper.load(websocketNode, flow, function() {
getSocket('server').on('connection', function(sock) {
sock.on('close', function() {