kaboot/tests/setup.tsx

20 lines
676 B
TypeScript

import React from 'react';
import '@testing-library/jest-dom/vitest';
import { cleanup } from '@testing-library/react';
import { afterEach, vi } from 'vitest';
afterEach(() => {
cleanup();
});
vi.mock('framer-motion', async () => {
const actual = await vi.importActual('framer-motion');
return {
...actual,
motion: {
div: ({ children, ...props }: React.HTMLAttributes<HTMLDivElement>) => <div {...props}>{children}</div>,
button: ({ children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>) => <button {...props}>{children}</button>,
},
AnimatePresence: ({ children }: { children: React.ReactNode }) => <>{children}</>,
};
});