Skip to content

Commit

Permalink
[test] Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Sep 6, 2023
1 parent 5b577fe commit c1d26c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/websocket-server.test.js
Expand Up @@ -281,11 +281,15 @@ describe('WebSocketServer', () => {

it('cleans event handlers on precreated server', (done) => {
const server = http.createServer();
const listeningListenerCount = server.listenerCount('listening');
const wss = new WebSocket.Server({ server });

server.listen(0, () => {
wss.close(() => {
assert.strictEqual(server.listenerCount('listening'), 0);
assert.strictEqual(
server.listenerCount('listening'),
listeningListenerCount
);
assert.strictEqual(server.listenerCount('upgrade'), 0);
assert.strictEqual(server.listenerCount('error'), 0);

Expand Down

0 comments on commit c1d26c3

Please sign in to comment.