Skip to content
Snippets Groups Projects
Commit 78861f8a authored by syuilo's avatar syuilo
Browse files

add test

parent 05a902f3
No related branches found
No related tags found
No related merge requests found
......@@ -93,6 +93,27 @@ describe('Streaming', () => {
server.close();
});
test('Connection#send', async () => {
const server = new WS('wss://misskey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
messaging.send('read', { id: 'aaa' });
await server.connected;
const connectMsg = JSON.parse(await server.nextMessage as string);
const channelId = connectMsg.body.id;
const msg = JSON.parse(await server.nextMessage as string);
expect(msg.type).toEqual('ch');
expect(msg.body.id).toEqual(channelId);
expect(msg.body.type).toEqual('read');
expect(msg.body.body).toEqual({ id: 'aaa' });
stream.close();
server.close();
});
test('Connection#dispose', async () => {
const server = new WS('wss://misskey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment