diff --git a/packages/vitest/src/integrations/env/jsdom-keys.ts b/packages/vitest/src/integrations/env/jsdom-keys.ts index 677ab3ab8f20..9e731dca0bbc 100644 --- a/packages/vitest/src/integrations/env/jsdom-keys.ts +++ b/packages/vitest/src/integrations/env/jsdom-keys.ts @@ -181,6 +181,8 @@ const LIVING_KEYS = [ 'Image', 'Audio', 'Option', + + 'CSS', ] const OTHER_KEYS = [ diff --git a/test/core/test/environments/happy-dom.spec.ts b/test/core/test/environments/happy-dom.spec.ts index ecb80ade1c9e..6ebf212397e2 100644 --- a/test/core/test/environments/happy-dom.spec.ts +++ b/test/core/test/environments/happy-dom.spec.ts @@ -1,6 +1,6 @@ // @vitest-environment happy-dom -import { afterEach, test, vi } from 'vitest' +import { afterEach, expect, test, vi } from 'vitest' afterEach(() => { vi.useRealTimers() @@ -9,3 +9,9 @@ afterEach(() => { test('fake timers don\'t fail when using empty config', () => { vi.useFakeTimers({}) }) + +test('global CSS is injected correctly', () => { + expect(CSS).toBeDefined() + expect(CSS.escape).toBeDefined() + expect(CSS.supports).toBeDefined() +})