ruvector/studio/tests/setup/polyfills.ts
rUv 814f595995 feat(studio): Add complete RuVector Studio application
Major additions:
- Complete Next.js studio application with 1600+ components
- Docker support (Dockerfile.combined, docker-compose.yml)
- GCP deployment documentation and benchmarks
- SQL benchmark scripts for performance testing
- Sentry integration for monitoring
- Comprehensive test suite and mocks

Studio features:
- Dashboard and admin interfaces
- Data visualization components
- Authentication and user management
- API integration with RuVector backend
- Static data and public assets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 23:04:48 +00:00

39 lines
1.1 KiB
TypeScript

import { TextDecoder, TextEncoder } from 'node:util'
import { ReadableStream, TransformStream } from 'node:stream/web'
import { vi } from 'vitest'
import { configMocks } from 'jsdom-testing-mocks'
import { act } from '@testing-library/react'
configMocks({ act })
// Warning: `restoreMocks: true` in vitest.config.ts will
// cause this global mockImplementation to be **reset**
// before any tests are run!
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: vi.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: vi.fn(), // deprecated
removeListener: vi.fn(), // deprecated
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
})),
})
Object.defineProperties(globalThis, {
TextDecoder: { value: TextDecoder },
TextEncoder: { value: TextEncoder },
CSS: {
value: {
supports: (_k: any, _v: any) => false,
escape: (v: any) => v,
},
},
ReadableStream: { value: ReadableStream },
TransformStream: { value: TransformStream },
})
window.HTMLElement.prototype.hasPointerCapture = vi.fn()