31 lines
856 B
TypeScript
31 lines
856 B
TypeScript
/**
|
|
* Vitest setup file — runs before all tests.
|
|
* Sets up happy-dom environment and imports required CSS modules.
|
|
*/
|
|
import { beforeAll } from 'vitest'
|
|
import '../src/styles/base.css'
|
|
import '../src/styles/window.css'
|
|
import '../src/styles/desktop.css'
|
|
import '../src/styles/apps.css'
|
|
import '../src/styles/apps2.css'
|
|
|
|
// Make global window properties available
|
|
beforeAll(() => {
|
|
// happy-dom may not support some APIs; polyfill what's needed
|
|
if (!window.matchMedia) {
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
writable: true,
|
|
value: (query: string) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: () => {},
|
|
removeListener: () => {},
|
|
addEventListener: () => {},
|
|
removeEventListener: () => {},
|
|
dispatchEvent: () => false,
|
|
}),
|
|
})
|
|
}
|
|
})
|