Skip to content

Commit

Permalink
[test] Fix failing test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Oct 4, 2018
1 parent 90407bb commit 9fe2f33
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/websocket.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,18 @@ describe('WebSocket', function () {
});

wss.on('connection', (ws) => {
const data = Buffer.alloc(1024, 61);

while (true) {
if (ws._socket.bufferSize > 0) {
assert.strictEqual(ws.bufferedAmount, ws._socket.bufferSize);
break;
}
ws.send('hello'.repeat(1e4));
ws.send(data);
}
wss.close(done);

ws.on('close', () => wss.close(done));
ws.close();
});
});
});
Expand Down

0 comments on commit 9fe2f33

Please sign in to comment.