summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-06-28 17:57:15 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-06-28 17:57:15 +0900
commitadb168dfdc0177dcca77d31c007774b1cfbb83b8 (patch)
tree3bacb0665c46cc609611492a28fa12d4a3d65251
parentrefactor (diff)
downloadmisskey-adb168dfdc0177dcca77d31c007774b1cfbb83b8.tar.gz
misskey-adb168dfdc0177dcca77d31c007774b1cfbb83b8.tar.bz2
misskey-adb168dfdc0177dcca77d31c007774b1cfbb83b8.zip
add test
-rw-r--r--test/streaming.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/streaming.ts b/test/streaming.ts
index d346d8cabc..4e2337f33b 100644
--- a/test/streaming.ts
+++ b/test/streaming.ts
@@ -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' });