mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-24 18:59:17 +00:00
Mock out window.addEventListener globally (#34028)
* Mock out window.addEventListener globally As some code uses it * Move to setupGlobals * clean up import * Only needed if we don't have happy-dom * thank you! Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --------- Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -16,5 +16,9 @@ vi.stubGlobal("AudioContext", function () {
|
||||
|
||||
if (globalThis.window === undefined) {
|
||||
// We are in a node environment, stub a basic window so singletons work
|
||||
vi.stubGlobal("window", {});
|
||||
vi.stubGlobal("window", {
|
||||
// Mock this as some code assumes it exists (needs to be done at the top level as
|
||||
// things try to access it before the beforeEach blocks run)
|
||||
addEventListener: vi.fn(),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user