mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix mocking websockets when running multiple tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user