[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

test: remove color-mode stub (#1287)

authored by

Daniel Roe and committed by
GitHub
da4a9639 0f5adf39

-27
-26
test/nuxt/setup.ts
··· 1 - /** 2 - * Global setup for Nuxt vitest environment. 3 - * 4 - * This file stubs globals that are normally initialized by inline scripts 5 - * injected into the HTML document, which don't run in vitest's nuxt environment. 6 - */ 7 - 8 - // Stub the @nuxtjs/color-mode global helper 9 - // The color-mode module injects a script that initializes this on window, 10 - // but in vitest the script never runs since the HTML page isn't SSR'd. 11 - // See: https://github.com/nuxt-modules/color-mode/issues/335 12 - if (typeof window !== 'undefined') { 13 - const globalName = '__NUXT_COLOR_MODE__' 14 - 15 - // @ts-expect-error - dynamic global name 16 - if (!window[globalName]) { 17 - // @ts-expect-error - dynamic global name 18 - window[globalName] = { 19 - preference: 'system', 20 - value: 'dark', 21 - getColorScheme: () => 'dark', 22 - addColorScheme: () => {}, 23 - removeColorScheme: () => {}, 24 - } 25 - } 26 - }
-1
vitest.config.ts
··· 25 25 name: 'nuxt', 26 26 include: ['test/nuxt/**/*.{test,spec}.ts'], 27 27 environment: 'nuxt', 28 - setupFiles: ['./test/nuxt/setup.ts'], 29 28 environmentOptions: { 30 29 nuxt: { 31 30 rootDir: fileURLToPath(new URL('.', import.meta.url)),