From 51de9f1caa0fb6457cf4fbf1a59df8158a2a89b4 Mon Sep 17 00:00:00 2001 From: volkanceylan Date: Sun, 22 Dec 2024 01:50:40 +0300 Subject: [PATCH] Fix test --- packages/corelib/src/base/html.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/corelib/src/base/html.spec.ts b/packages/corelib/src/base/html.spec.ts index 714932659e..cdcda77370 100644 --- a/packages/corelib/src/base/html.spec.ts +++ b/packages/corelib/src/base/html.spec.ts @@ -218,9 +218,11 @@ describe("appendToNode", () => { div.innerHTML = "test"; const unhandledRejection = () => { done(void 0); - (globalThis.process?.off || window.removeEventListener as any)("unhandledrejection", unhandledRejection); + globalThis.process?.off ? globalThis.process.off("unhandledRejection", unhandledRejection) : + window.removeEventListener("unhandledrejection", unhandledRejection); }; - (globalThis.process?.on || window.addEventListener as any)("unhandledrejection", unhandledRejection); + globalThis.process?.on ? globalThis.process.on("unhandledRejection", unhandledRejection) : + window.addEventListener("unhandledrejection", unhandledRejection); appendToNode(parent, Promise.reject("some reject reason")); expect(parent.innerHTML).toBe(""); await Promise.resolve();