Open kettanaito opened 3 months ago
Alas, the binding depends on the Interceptors, and there's no broadcasting concept there.
I think the binding should accept the entire WebSocket link. That way, it can also use the broadcasting capabilities of MSW relying on its own client manager.
import { ws } from 'msw'
import { bind } from '@mswjs/socket.io-binding'
const api = bind(ws.link('*'))
api.on('connection', (args) => {})
MSW
ws
now supports broadcasting so we should propagate that support to the SocketIO binding..broadcast()
and.broadcastExcept()
methods on the MSW event handler.