Skip to content

Commit

Permalink
[test] Increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Jun 13, 2024
1 parent ddfe4a8 commit 6a00029
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ class Sender {
options.generateMask(mask);
} else {
if (randomPoolPointer === RANDOM_POOL_SIZE) {
/* istanbul ignore else */
if (randomPool === undefined) {
//
// This is lazily initialized because server-sent frames must not
// be masked so it may never be used.
//
randomPool = Buffer.alloc(RANDOM_POOL_SIZE);
}

Expand Down
2 changes: 1 addition & 1 deletion test/receiver.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ describe('Receiver', () => {
receiver.on('ping', listener);
receiver.on('pong', listener);

receiver.write(Buffer.from('8101318901328a0133810134', 'hex'));
receiver.write(Buffer.from('8101318901328a0133820134', 'hex'));
});

it('does not swallow errors thrown from event handlers', (done) => {
Expand Down
1 change: 1 addition & 0 deletions test/websocket.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4423,6 +4423,7 @@ describe('WebSocket', () => {
'The socket was closed while data was being compressed'
);
});
ws.close();
});
}
);
Expand Down

0 comments on commit 6a00029

Please sign in to comment.