Skip to content

Commit ba185e8

Browse files
FdawgsUzlopak
andauthored
test: replace typeof undefined check (#272)
* test: replace `typeof` undefined check * simplify --------- Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
1 parent 619e125 commit ba185e8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

test/base.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,7 @@ test('Should be able to pass custom connectionOptions to createWebSocketStream',
324324
})
325325

326326
fastify.get('/', { websocket: true }, (connection) => {
327-
// readableObjectMode was added in Node v12.3.0 so for earlier versions
328-
// we check the encapsulated readable state directly
329-
const mode = (typeof connection.readableObjectMode === 'undefined')
330-
? connection._readableState.objectMode
331-
: connection.readableObjectMode
332-
t.equal(mode, true)
327+
t.equal(connection.readableObjectMode, true)
333328
connection.socket.binaryType = 'arraybuffer'
334329

335330
connection.once('data', (chunk) => {

0 commit comments

Comments
 (0)