Skip to content

Commit 1863504

Browse files
committed
[test] Use WebSocket.CONNECTING instead of 0
Use the `WebSocket.CONNECTING` constant instead of hardcoding its value.
1 parent cd607c0 commit 1863504

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/create-websocket-stream.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('createWebSocketStream', () => {
4949
const wss = new WebSocket.Server({ port: 0 }, () => {
5050
const ws = new WebSocket(`ws://localhost:${wss.address().port}`);
5151

52-
assert.strictEqual(ws.readyState, 0);
52+
assert.strictEqual(ws.readyState, WebSocket.CONNECTING);
5353

5454
const duplex = createWebSocketStream(ws);
5555

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

135-
assert.strictEqual(ws.readyState, 0);
135+
assert.strictEqual(ws.readyState, WebSocket.CONNECTING);
136136

137137
const duplex = createWebSocketStream(ws);
138138

0 commit comments

Comments
 (0)