mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-15 01:48:01 -05:00
26 lines
602 B
JavaScript
26 lines
602 B
JavaScript
var parser = require('..');
|
|
var expect = require('expect.js');
|
|
var helpers = require('./helpers.js');
|
|
var encode = parser.encode;
|
|
var decode = parser.decode;
|
|
|
|
describe('parser', function() {
|
|
it('encodes a Buffer', function() {
|
|
helpers.test_bin({
|
|
type: parser.BINARY_EVENT,
|
|
data: ['a', Buffer.from('abc', 'utf8')],
|
|
id: 23,
|
|
nsp: '/cool'
|
|
});
|
|
});
|
|
|
|
it('encodes a binary ack with Buffer', function() {
|
|
helpers.test_bin({
|
|
type: parser.BINARY_ACK,
|
|
data: ['a', Buffer.from('xxx', 'utf8'), {}],
|
|
id: 127,
|
|
nsp: '/back'
|
|
})
|
|
});
|
|
});
|