mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
The assertions were not checked, because the functions are asynchronous. Besides, the Blob tests were throwing in the browser: > Uncaught ReferenceError: can't access lexical declaration 'BlobBuilder' before initialization
23 lines
532 B
JavaScript
23 lines
532 B
JavaScript
const { PacketType } = require('..');
|
|
const helpers = require('./helpers.js');
|
|
|
|
describe('parser', () => {
|
|
it('encodes a Buffer', done => {
|
|
helpers.test_bin({
|
|
type: PacketType.BINARY_EVENT,
|
|
data: ['a', Buffer.from('abc', 'utf8')],
|
|
id: 23,
|
|
nsp: '/cool'
|
|
}, done);
|
|
});
|
|
|
|
it('encodes a binary ack with Buffer', done => {
|
|
helpers.test_bin({
|
|
type: PacketType.BINARY_ACK,
|
|
data: ['a', Buffer.from('xxx', 'utf8'), {}],
|
|
id: 127,
|
|
nsp: '/back'
|
|
}, done)
|
|
});
|
|
});
|