teach tests about the new way we fail websockets
This commit is contained in:
parent
e111d8aa55
commit
77852b8cce
3 changed files with 11 additions and 2 deletions
|
|
@ -377,6 +377,12 @@ export function connectStream<C extends keyof misskey.Channels>(user: UserToken,
|
|||
const ws = new WebSocket(url, options);
|
||||
|
||||
ws.on('unexpected-response', (req, res) => rej(res));
|
||||
ws.on('close', (code, reason) => {
|
||||
rej({
|
||||
statusCode: code,
|
||||
reason: reason.toString('utf8'),
|
||||
});
|
||||
});
|
||||
ws.on('open', () => {
|
||||
ws.on('message', data => {
|
||||
const msg = JSON.parse(data.toString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue