diff --git a/test/run.test.js b/test/run.test.js index ad1c4942..4b2e9fcd 100644 --- a/test/run.test.js +++ b/test/run.test.js @@ -70,6 +70,21 @@ function __triggerKeyboardFocus(el, keyCode, opt) { el.dispatchEvent ? el.dispatchEvent(eventObj) : el.fireEvent('onfocus', eventObj); } +jest.mock('ws', () => { + return { + WebSocket: class { + constructor(url) { + this.url = url; + this.readyState = 1; + this.send = jest.fn(); + this.close = jest.fn(); + this.addEventListener = jest.fn(); + this.removeEventListener = jest.fn(); + } + } + }; +}); + beforeAll(async () => { browser = await puppeteer.launch({ args: ['--no-sandbox'] }); page = await browser.newPage();