Skip to content

Commit 5876c9e

Browse files
fix test
1 parent 1c50859 commit 5876c9e

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

packages/socket.io/test/socket.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from "./support/util";
1010
import { Server } from "..";
1111
import expect from "expect.js";
12+
import { Decoder, Encoder } from "socket.io-parser";
1213

1314
describe("socket", () => {
1415
it("should not fire events more than once after manually reconnecting", (done) => {
@@ -158,8 +159,27 @@ describe("socket", () => {
158159
});
159160

160161
it("should emit events with several types of data (including binary)", (done) => {
161-
const io = new Server(0);
162-
const socket = createClient(io);
162+
class CustomDecoder extends Decoder {
163+
constructor() {
164+
super({
165+
maxAttachments: 10,
166+
});
167+
}
168+
}
169+
170+
const io = new Server(0, {
171+
parser: {
172+
Decoder: CustomDecoder,
173+
Encoder,
174+
},
175+
});
176+
177+
const socket = createClient(io, "/", {
178+
parser: {
179+
Decoder: CustomDecoder,
180+
Encoder,
181+
},
182+
});
163183

164184
socket.on("multiple", (a, b, c, d, e, f) => {
165185
expect(a).to.be(1);

0 commit comments

Comments
 (0)