Skip to content

Commit

Permalink
fix: Close connection with 1005 status if no error occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Jul 28, 2021
1 parent 95bf3f3 commit 2947d99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/MockWebSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class MockWebSocket extends EventEmitter {
const duplex = new Duplex({
objectMode: true,
destroy(error: Error | null, callback: (error: Error | null) => void): void {
connection.emit('close', 1006);
connection.emit('close', error ? 1006 : 1005);
callback(error);
},
read(_size: number): void {
Expand Down

0 comments on commit 2947d99

Please sign in to comment.