Skip to content

Commit

Permalink
test: add test with onAnyOutgoing() and binary attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Jan 30, 2023
1 parent f27cba5 commit 9f32925
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions test/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,25 @@ describe("socket", () => {
});
});

it("should call listener with binary data", () => {
return wrap((done) => {
const socket = io(BASE_URL + "/abc", {
forceNew: true,
});

socket.on("connect", () => {
socket.onAnyOutgoing((event, arg1) => {
expect(event).to.be("my-event");
expect(arg1).to.be.an(Uint8Array);

success(done, socket);
});

socket.emit("my-event", Uint8Array.of(1, 2, 3));
});
});
});

it("should prepend listener", () => {
return wrap((done) => {
const socket = io(BASE_URL + "/abc", {
Expand Down

0 comments on commit 9f32925

Please sign in to comment.