forked from socketio/socket.io
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved library files into lib/socket.io for future npm support Added tests for encoding / decoding Fixed inheritance of certain classes Fixed options supports
- Loading branch information
Showing
12 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test: | ||
./tests/support/expresso/bin/expresso -I lib $(TESTFLAGS) tests/*.test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
lib/transports/flashsocket.js → lib/socket.io/transports/flashsocket.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var listener = require('socket.io/listener'), | ||
Client = require('socket.io/client'); | ||
|
||
module.exports = { | ||
'test decoding': function(assert){ | ||
var client = new Client(listener, {}, {}), | ||
decoded = client._decode('\ufffdm\ufffd5\ufffdm\ufffdabcde' + '\ufffdm\ufffd9\ufffdm\ufffd123456789'); | ||
assert.equal(decoded.length, 2); | ||
assert.equal(decoded[0], 'abcde'); | ||
assert.equal(decoded[1], '123456789'); | ||
}, | ||
|
||
'test decoding of bad framed messages': function(assert){ | ||
var client = new Client(listener, {}, {}), | ||
decoded = client._decode('\ufffdm\ufffd5\ufffdm\ufffdabcde' + '\ufffdm\uffsdaasdfd9\ufffdm\ufffd1aaa23456789'); | ||
assert.equal(decoded.length, 1); | ||
assert.equal(decoded[0], 'abcde'); | ||
assert.equal(decoded[1], undefined); | ||
}, | ||
|
||
'test encoding': function(assert){ | ||
var client = new Client(listener, {}, {}), | ||
encoded = client._encode(['abcde', '123456789']); | ||
assert.equal(encoded, '\ufffdm\ufffd5\ufffdm\ufffdabcde' + '\ufffdm\ufffd9\ufffdm\ufffd123456789'); | ||
} | ||
}; |