/
githubmirror
/
socket.io
Обзор
Документация
Войти
/
githubmirror
/
socket.io
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/socket.io-client/test/node.ts
39 строк
1 KB
Damien Arrachequesne
test(sio-client): reduce test suite duration
18 сен 2024, 08:52
Не верифицирован
18 сен 2024, 08:52
09f573c
Код
Авторство
О чём код?
const path = require("path"); const { exec } = require("child_process"); describe("autoUnref option", function () { before(function () { if (process.env.WDIO_WORKER_ID !== undefined) { return this.skip(); } }); const fixture = (filename) => process.execPath + " " + path.join(__dirname, "fixtures", filename); it("should stop once the timer is triggered", (done) => { exec(fixture("unref.ts"), done); }); it("should stop once the timer is triggered (even when trying to reconnect)", (done) => { exec(fixture("unref-during-reconnection.ts"), done); }); it("should stop once the timer is triggered (polling)", (done) => { exec(fixture("unref-polling-only.ts"), done); }); it("should stop once the timer is triggered (websocket)", (done) => { exec(fixture("unref-websocket-only.ts"), done); }); it("should not stop with autoUnref set to false", (done) => { const process = exec(fixture("no-unref.ts"), () => { done(new Error("should not happen")); }); setTimeout(() => { process.kill(); done(); }, 100); }); });