mirror of
https://github.com/penpot/penpot.git
synced 2025-05-09 23:06:43 +02:00
🐛 Fix mocking websockets when running multiple tests
This commit is contained in:
parent
575873eba7
commit
d43458ee89
5 changed files with 51 additions and 36 deletions
|
@ -46,14 +46,14 @@ window.WebSocket = class MockWebSocket extends EventTarget {
|
|||
|
||||
MockWebSocket.#mocks.set(this.#url, this);
|
||||
|
||||
if (typeof window["MockWebSocket$$constructor"] === "function") {
|
||||
MockWebSocket$$constructor(this.#url, this.#protocols);
|
||||
if (typeof window["onMockWebSocketConstructor"] === "function") {
|
||||
onMockWebSocketConstructor(this.#url, this.#protocols);
|
||||
}
|
||||
if (typeof window["MockWebSocket$$spyMessage"] === "function") {
|
||||
this.#spyMessage = MockWebSocket$$spyMessage;
|
||||
if (typeof window["onMockWebSocketSpyMessage"] === "function") {
|
||||
this.#spyMessage = onMockWebSocketSpyMessage;
|
||||
}
|
||||
if (typeof window["MockWebSocket$$spyClose"] === "function") {
|
||||
this.#spyClose = MockWebSocket$$spyClose;
|
||||
if (typeof window["onMockWebSocketSpyClose"] === "function") {
|
||||
this.#spyClose = onMockWebSocketSpyClose;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue