mirror of https://github.com/node-red/node-red.git
Fixup websocket tests as we now need a client
parent
4349b58dc5
commit
62bd0fc0eb
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue