diff --git a/packages/ui/src/CodeBlock/CodeBlock.test.tsx b/packages/ui/src/CodeBlock/CodeBlock.test.tsx index 913a8c0..632ca2c 100644 --- a/packages/ui/src/CodeBlock/CodeBlock.test.tsx +++ b/packages/ui/src/CodeBlock/CodeBlock.test.tsx @@ -2,6 +2,16 @@ import { render, screen, waitFor } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { CodeBlock } from './CodeBlock'; +// Mock react-syntax-highlighter to avoid ESM compatibility issues +vi.mock('react-syntax-highlighter', () => ({ + Prism: ({ children, ...props }: any) => {children}, +})); + +vi.mock('react-syntax-highlighter/dist/esm/styles/prism', () => ({ + prism: {}, + vscDarkPlus: {}, +})); + // Mock clipboard API const mockClipboard = { writeText: vi.fn(),