Skip to content

Commit

Permalink
[test] Use WebSocket.CONNECTING instead of 0
Browse files Browse the repository at this point in the history
Use the `WebSocket.CONNECTING` constant instead of hardcoding its value.
  • Loading branch information
lpinca committed Jan 25, 2020
1 parent cd607c0 commit 1863504
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/create-websocket-stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('createWebSocketStream', () => {
const wss = new WebSocket.Server({ port: 0 }, () => {
const ws = new WebSocket(`ws://localhost:${wss.address().port}`);

assert.strictEqual(ws.readyState, 0);
assert.strictEqual(ws.readyState, WebSocket.CONNECTING);

const duplex = createWebSocketStream(ws);

Expand Down Expand Up @@ -132,7 +132,7 @@ describe('createWebSocketStream', () => {
const wss = new WebSocket.Server({ port: 0 }, () => {
const ws = new WebSocket(`ws://localhost:${wss.address().port}`);

assert.strictEqual(ws.readyState, 0);
assert.strictEqual(ws.readyState, WebSocket.CONNECTING);

const duplex = createWebSocketStream(ws);

Expand Down

0 comments on commit 1863504

Please sign in to comment.