mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
- Fixed vitest matcher usage: replaced toBeTypeOf with typeof + toBe - Fixed import statements for fs and path modules to use namespace imports - Resolves TypeScript compilation errors preventing push Part of fixing test setup issues for PR #227
32 lines
798 B
TypeScript
32 lines
798 B
TypeScript
import '@testing-library/jest-dom';
|
|
|
|
// Mock ResizeObserver
|
|
globalThis.ResizeObserver = vi.fn().mockImplementation(() => ({
|
|
observe: vi.fn(),
|
|
unobserve: vi.fn(),
|
|
disconnect: vi.fn(),
|
|
}));
|
|
|
|
// Mock IntersectionObserver
|
|
globalThis.IntersectionObserver = vi.fn().mockImplementation(() => ({
|
|
observe: vi.fn(),
|
|
unobserve: vi.fn(),
|
|
disconnect: vi.fn(),
|
|
}));
|
|
|
|
// Mock matchMedia for next-themes
|
|
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(),
|
|
})),
|
|
});
|
|
|
|
beforeEach(() => vi.clearAllMocks());
|