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

add test

parent 8bc7daa3
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,28 @@ describe('Streaming', () => {
server.close();
});
test('ちゃんとチャンネルごとにidが異なる', async () => {
const server = new WS('wss://misskey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
stream.useChannel('messaging', { otherparty: 'aaa' });
stream.useChannel('messaging', { otherparty: 'bbb' });
await server.connected;
const msg = JSON.parse(await server.nextMessage as string);
const messagingChannelId = msg.body.id;
const msg2 = JSON.parse(await server.nextMessage as string);
const messagingChannelId2 = msg2.body.id;
expect(messagingChannelId != null).toEqual(true);
expect(messagingChannelId2 != null).toEqual(true);
expect(messagingChannelId).not.toEqual(messagingChannelId2);
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