Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanceylan committed Dec 21, 2024
1 parent 077bdbe commit 51de9f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/corelib/src/base/html.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("<!--Loading content...-->");
await Promise.resolve();
Expand Down

0 comments on commit 51de9f1

Please sign in to comment.