Skip to content

Commit 4635aca

Browse files
committed
Merge branch 'master' into williamhogman-patch-1
2 parents 55b0291 + 5f737b6 commit 4635aca

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

package.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"name": "nodejs-websocket",
3-
"version": "1.2.0",
4-
"author": "Sitegui <[email protected]>",
5-
"description": "Basic server&client approach to websocket (text and binary frames)",
6-
"main": "./index.js",
7-
"repository": {
8-
"type": "git",
9-
"url": "https://github.com/sitegui/nodejs-websocket"
10-
},
11-
"keywords": [
12-
"websocket",
13-
"websocket-server",
14-
"websocket-client"
15-
],
16-
"license": "MIT",
17-
"engines": {
18-
"node": ">=0.10"
19-
},
20-
"scripts": {
21-
"test": "mocha -R spec -b"
22-
},
23-
"devDependencies": {
24-
"mocha": "^2.1.0",
25-
"should": "^4.4.1"
26-
}
27-
}
2+
"name": "nodejs-websocket",
3+
"version": "1.2.0",
4+
"author": "Sitegui <[email protected]>",
5+
"description": "Basic server&client approach to websocket (text and binary frames)",
6+
"main": "./index.js",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/sitegui/nodejs-websocket"
10+
},
11+
"keywords": [
12+
"websocket",
13+
"websocket-server",
14+
"websocket-client"
15+
],
16+
"license": "MIT",
17+
"engines": {
18+
"node": ">=0.10"
19+
},
20+
"scripts": {
21+
"test": "mocha -R spec -b"
22+
},
23+
"devDependencies": {
24+
"mocha": "^2.2.1",
25+
"should": "^5.2.0"
26+
}
27+
}

test/test.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ describe('text frames', function () {
8686
// If it arrives, send another, wait again and done
8787
getServer(null, function (inStream) {
8888
inStream.on('readable', function () {
89-
compareBuffers(inStream.read(), buffer)
89+
var read = inStream.read()
90+
if (!read) {
91+
// Ignore when read() returns null
92+
return
93+
}
94+
compareBuffers(read, buffer)
9095
if (again) {
9196
stream.end(buffer)
9297
again = false
@@ -124,6 +129,7 @@ describe('handshake', function () {
124129
before(function (done) {
125130
testServer = ws.createServer(function (conn) {
126131
testConn = conn
132+
127133
// Send frame right after handshake answer
128134
conn.sendText('hello')
129135
}).listen(TEST_PORT, done)

0 commit comments

Comments
 (0)