From 0aa65a8ffacb1257c3287494dc99e011edd701df Mon Sep 17 00:00:00 2001 From: Hans Date: Wed, 18 Dec 2019 01:43:49 +0800 Subject: [PATCH] fix test script --- client/index.js | 2 +- test/cases/ws-client.js | 2 +- test/cases/wss-client.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/index.js b/client/index.js index 4093392..877d517 100644 --- a/client/index.js +++ b/client/index.js @@ -37,7 +37,7 @@ class WSClient extends EventEmitter { if (this.connectState !== 2) { if (message === '\x00\x02') { this.connectState = 2 - this.emit('ready') + this.emit('connect') } else { this.emit('error', new Error('Client version mismatch.')) } diff --git a/test/cases/ws-client.js b/test/cases/ws-client.js index 8656e4f..4398315 100644 --- a/test/cases/ws-client.js +++ b/test/cases/ws-client.js @@ -6,7 +6,7 @@ module.exports = function ({ HTTP_PORT }) { ws.on('error', reject) - ws.on('ready', async () => { + ws.on('connect', async () => { try { { const data = { 'Hello': 'World' } diff --git a/test/cases/wss-client.js b/test/cases/wss-client.js index dfaf7f2..b08afef 100644 --- a/test/cases/wss-client.js +++ b/test/cases/wss-client.js @@ -6,7 +6,7 @@ module.exports = function ({ HTTPS_PORT }) { ws.on('error', reject) - ws.on('ready', async () => { + ws.on('connect', async () => { try { { const data = { 'Hello': 'World' }