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:
+2
-2
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user