fix(test): use bare matchMedia() instead of window.matchMedia() for Node ESM compat

global.window assignment doesn't expose 'window' as an identifier in ESM modules
in Node.js 22. matchMedia() is a global in browsers - no window. prefix needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ulas
2026-04-05 13:06:18 +02:00
parent 205ff603d4
commit 796fe38913
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -10,8 +10,8 @@ import assert from 'node:assert/strict';
// /i18n.js wird durch test-browser-loader.mjs gemockt (--loader Flag)
const { wireBlurValidation, btnSuccess, btnError } = await import('./public/components/modal.js');
// window.matchMedia und document.createElementNS werden von btnSuccess/btnError benötigt
global.window = { matchMedia: () => ({ matches: false }) };
// matchMedia und document.createElementNS werden von btnSuccess/btnError benötigt
global.matchMedia = () => ({ matches: false });
const _makeSvgEl = (tag) => {
const attrs = {};