mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-12 16:38:12 -05:00
This major bump creates a lot of noise, but it is necessary for
prettier to be able to parse new syntax such as:
- typed imports: `import { type xxx } from ...`
- private attributes: `class A { #b; #c() {} }`
23 lines
564 B
JavaScript
23 lines
564 B
JavaScript
const expect = require("expect.js");
|
|
const parser = require("../build/parser-v3/index.js");
|
|
|
|
describe("parser", () => {
|
|
it("properly encodes a mixed payload", (done) => {
|
|
parser.encodePayload(
|
|
[
|
|
{ type: "message", data: "€€€€" },
|
|
{ type: "message", data: Buffer.from([1, 2, 3]) },
|
|
],
|
|
true,
|
|
(encoded) => {
|
|
expect(encoded).to.be.a(Buffer);
|
|
|
|
parser.decodePayload(encoded, (decoded) => {
|
|
expect(decoded.data).to.eql("€€€€");
|
|
done();
|
|
});
|
|
}
|
|
);
|
|
});
|
|
});
|