diff --git a/package.json b/package.json index 4c8bc5b..2b27548 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "SocketIO client running inside a shared WebWorker thread", "main": "index.js", "scripts": { - "test": "mocha", + "test": "mocha test/*.test.js", "test:e2e": "npx cypress open", "start": "node server.js", "start:io": "node server.js", diff --git a/test/socket.io-worker.test.js b/test/socket.io-worker.test.js index 52754af..197c97a 100644 --- a/test/socket.io-worker.test.js +++ b/test/socket.io-worker.test.js @@ -16,6 +16,7 @@ describe('socket.io-worker', () => { ws.on('message', event => { assert(event === hello) + if (ws.socket) ws.socket.close() // @todo fix done() }) })