/
githubmirror
/
socket.io
Обзор
Документация
Войти
/
githubmirror
/
socket.io
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/engine.io-client/test/binary-fallback.js
26 строк
667 B
Damien Arrachequesne
refactor: prepare the migration to a monorepo
08 июл 2024, 11:59
Не верифицирован
08 июл 2024, 11:59
32a1a60
Код
Авторство
О чём код?
const expect = require("expect.js"); const eio = require("../"); describe("binary fallback", function () { this.timeout(10000); it("should be able to receive binary data when ArrayBuffer not available (polling)", (done) => { const socket = new eio.Socket({ forceBase64: true }); socket.on("open", () => { socket.send("give binary"); let firstPacket = true; socket.on("message", (data) => { if (firstPacket) { firstPacket = false; return; } expect(data.base64).to.be(true); expect(data.data).to.equal("AAECAwQ="); socket.close(); done(); }); }); }); });