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

fix connection close logic

parent 1d17516a
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
"build": "npm run tsc",
"tsc": "tsc",
"tsd": "tsd",
"jest": "jest",
"jest": "jest --detectOpenHandles",
"test": "npm run jest && npm run tsd"
},
"repository": {
......
......@@ -255,8 +255,7 @@ export default class Stream extends EventEmitter<StreamEvents> {
*/
@autobind
public close() {
this.stream.removeEventListener('open', this.onOpen);
this.stream.removeEventListener('message', this.onMessage);
this.stream.close();
}
}
......
......@@ -32,12 +32,14 @@ describe('Streaming', () => {
id: 'foo'
});
stream.close();
server.close();
});
/* TODO
test('useChannel with parameters', async () => {
// TODO
});
*/
test('Connection#dispose', async () => {
const server = new WS('wss://misskey.test/streaming');
......@@ -68,6 +70,7 @@ describe('Streaming', () => {
expect(mainChannelReceived.length).toEqual(0);
stream.close();
server.close();
});
......
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