Skip to content

Commit 26ed5d2

Browse files
minrkconsideRatio
authored andcommitted
tst: ws 8 messages are Buffers, must call toString
1 parent 003f1dc commit 26ed5d2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/testutil.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var addTarget = (exports.addTarget = function (proxy, path, port, websocket, tar
3636
wss.on("connection", function (ws) {
3737
ws.on("message", function (message) {
3838
var reply = extend({}, data);
39-
reply.message = message;
39+
reply.message = message.toString();
4040
ws.send(JSON.stringify(reply));
4141
});
4242
ws.send("connected");

test/proxy_spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ describe("Proxy Tests", function () {
6161
});
6262
var nmsgs = 0;
6363
ws.on("message", function (msg) {
64+
msg = msg.toString();
6465
if (nmsgs === 0) {
6566
expect(msg).toEqual("connected");
6667
} else {

0 commit comments

Comments
 (0)