diff --git a/index.ts b/index.ts index 1ec1fc6..bdc8341 100644 --- a/index.ts +++ b/index.ts @@ -47,7 +47,7 @@ export default class WSReqonet extends EventEmitter { this.ws = new window.WebSocket(url, protocols); this.connect(); } - private onOpen = () => { + private onopen = () => { this.emit("open"); this.forcedClose = false; }; @@ -80,7 +80,7 @@ export default class WSReqonet extends EventEmitter { private connect = () => { this.ws.onclose = this.onclose; this.ws.onerror = this.onError; - this.ws.onopen = this.onOpen; + this.ws.onopen = this.onopen; this.ws.onmessage = this.onmessage; if (this.queueMessage) { diff --git a/package.json b/package.json index 37c8494..15f25dc 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "prepare": "husky install", "tsc": "tsc", "build": "tsup", - "test": "tsd && ava", + "test": "tsc && tsd && ava", "pretty-quick": "pretty-quick --staged" }, "sideEffects": false,