mirror of
https://github.com/alsk1992/CloddsBot.git
synced 2026-10-02 02:54:40 +08:00
Fix webchat test for WSS single-dispatcher refactor
Wire connection handler manually in test since start() no longer registers on WSS directly. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
7edb42d30b
commit
7a7806979c
@@ -69,6 +69,12 @@ test('webchat auth and message flow', async () => {
|
||||
);
|
||||
channel.start(wss);
|
||||
|
||||
// After the WSS single-dispatcher refactor, start() no longer registers
|
||||
// a listener on wss directly — the gateway server dispatches via a mutable
|
||||
// callback. In tests we wire it up manually.
|
||||
const handler = channel.getConnectionHandler();
|
||||
if (handler) wss.on('connection', handler);
|
||||
|
||||
const ws = new WebSocket(`ws://127.0.0.1:${port}/chat`);
|
||||
const queue = createMessageQueue(ws);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user