From c8d9816d3d427057a3b05ccca06b9b23d1e0d261 Mon Sep 17 00:00:00 2001 From: David Ortner <> Date: Thu, 7 Sep 2023 15:34:31 +0200 Subject: [PATCH] fix: use the nodejs console in happy-dom v11 --- 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', })