From 59434189bb3bb449df048e2aad1bf990335720f3 Mon Sep 17 00:00:00 2001 From: David Ortner Date: Fri, 8 Sep 2023 10:16:05 +0200 Subject: [PATCH] fix(happy-dom): use the nodejs console in happy-dom v11 (#4090) Co-authored-by: David Ortner <> --- packages/vitest/src/integrations/env/happy-dom.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vitest/src/integrations/env/happy-dom.ts b/packages/vitest/src/integrations/env/happy-dom.ts index 21936fafe990..9efedcbe47fa 100644 --- a/packages/vitest/src/integrations/env/happy-dom.ts +++ b/packages/vitest/src/integrations/env/happy-dom.ts @@ -34,6 +34,7 @@ export default ({ const { Window, GlobalWindow } = await importModule('happy-dom') as typeof import('happy-dom') const win = new (GlobalWindow || Window)({ ...happyDOM, + console: (console && global.console) ? global.console : undefined, url: happyDOM.url || 'http://localhost:3000', })