diff --git a/tests/test-dhcp-ws-manual.js b/tests/test-dhcp-ws-manual.js index 5eb8a6b90..814ffc89c 100644 --- a/tests/test-dhcp-ws-manual.js +++ b/tests/test-dhcp-ws-manual.js @@ -92,6 +92,10 @@ if (board.name === "arduino_101") { }); SocketBody(WSServer); + + WSServer.on('error', function (error) { + console.log('Server socket: ' + error.name + ': ' + error.message); + }); }); netConfig.on("netdown", function() { @@ -122,5 +126,9 @@ if (board.name === "arduino_101") { }); SocketBody(WSServer); + + WSServer.on('error', function (error) { + console.log('Server socket: ' + error.name + ': ' + error.message); + }); }); } diff --git a/tests/test-ws4-server-dhcp.js b/tests/test-ws4-server-dhcp.js index aeae9b49b..c4900f029 100644 --- a/tests/test-ws4-server-dhcp.js +++ b/tests/test-ws4-server-dhcp.js @@ -3,7 +3,7 @@ // Run this test case and run ws client on linux with // tests/tools/test-ws4-client-dhcp.js -console.log("Test web socket server APIs on IPv4 with DHCP mode..."); +console.log("Test websocket server APIs on IPv4 with DHCP mode..."); var WebSocket = require("ws"); var assert = require("Assert.js"); @@ -32,13 +32,13 @@ netConfig.dhcp(function(address, subnet, gateway) { }); assert(typeof WSServer === "object" && WSServer !== null, - "WSServerObject: be defined"); + "WSServer object is defined"); WSServer.on("connection", function(websocket) { assert(true, "WSServerObject: accept client connected"); assert(true, "WSServerEvent: be called as 'connection' event"); - console.log("Creat web socket connection successful"); + console.log("Create websocket connection successful"); var messageFlag = true; var sendNoMaskFlag = false; @@ -203,4 +203,8 @@ netConfig.dhcp(function(address, subnet, gateway) { } }, 3000); }); + + WSServer.on('error', function (error) { + console.log('Server socket: ' + error.name + ': ' + error.message); + }); });