Skip to content

Commit

Permalink
test: update test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 7, 2024
1 parent 5d39bf3 commit 2fa546a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/run.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2fa546a

Please sign in to comment.