···11-/**
22- * Global setup for Nuxt vitest environment.
33- *
44- * This file stubs globals that are normally initialized by inline scripts
55- * injected into the HTML document, which don't run in vitest's nuxt environment.
66- */
77-88-// Stub the @nuxtjs/color-mode global helper
99-// The color-mode module injects a script that initializes this on window,
1010-// but in vitest the script never runs since the HTML page isn't SSR'd.
1111-// See: https://github.com/nuxt-modules/color-mode/issues/335
1212-if (typeof window !== 'undefined') {
1313- const globalName = '__NUXT_COLOR_MODE__'
1414-1515- // @ts-expect-error - dynamic global name
1616- if (!window[globalName]) {
1717- // @ts-expect-error - dynamic global name
1818- window[globalName] = {
1919- preference: 'system',
2020- value: 'dark',
2121- getColorScheme: () => 'dark',
2222- addColorScheme: () => {},
2323- removeColorScheme: () => {},
2424- }
2525- }
2626-}