Show users in voice channels before joining
Build and Publish / Metadata (push) Successful in 1s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 24s

This commit is contained in:
mats committed 2026-09-22 10:45:08 +02:00
1 parent a29bd58b0c
commit dee8ef4f7c
3 files changed
+185 -82

No files matched your search

+19 -2
View File
@@ -38,15 +38,23 @@ test('server HTTP and WebSocket signaling endpoints', async (t) => {
const healthText = await resHealth.text();
assert.strictEqual(healthText, 'ok');
// test /api/rooms initially empty
const resRoomsInit = await fetch(`http://127.0.0.1:${port}/api/rooms`);
assert.strictEqual(resRoomsInit.status, 200);
const roomsInit = await resRoomsInit.json();
assert.deepStrictEqual(roomsInit, {});
// test WebSocket signaling /ws
const { WebSocket } = require('ws');
const ws = new WebSocket(`ws://127.0.0.1:${port}/ws?room=testroom&name=tester`);
const messages = [];
const helloPromise = new Promise((resolve, reject) => {
ws.on('message', (raw) => {
try {
const msg = JSON.parse(raw.toString());
resolve(msg);
messages.push(msg);
if (msg.type === 'hello') resolve(msg);
} catch (err) {
reject(err);
}
@@ -55,10 +63,19 @@ test('server HTTP and WebSocket signaling endpoints', async (t) => {
});
const msg = await helloPromise;
ws.close();
assert.strictEqual(msg.type, 'hello');
assert.strictEqual(msg.room, 'testroom');
assert.ok(msg.id, 'client id assigned');
// test /api/rooms while tester is connected
const resRoomsActive = await fetch(`http://127.0.0.1:${port}/api/rooms`);
assert.strictEqual(resRoomsActive.status, 200);
const roomsActive = await resRoomsActive.json();
assert.ok(roomsActive.testroom, 'testroom present in /api/rooms');
assert.strictEqual(roomsActive.testroom.length, 1);
assert.strictEqual(roomsActive.testroom[0].name, 'tester');
ws.close();
});
test('TURN credentials generation with TURN_SECRET', () => {