diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index 52a5f91..ffa1f37 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -11,17 +11,7 @@ interface ErrorBoundaryProps { fallback?: ReactNode; } -interface ErrorMessage { - type: 'mkstack-error'; - error: { - message: string; - stack?: string; - componentStack?: string; - url: string; - timestamp: string; - userAgent: string; - }; -} + export class ErrorBoundary extends Component { constructor(props: ErrorBoundaryProps) { @@ -43,26 +33,6 @@ export class ErrorBoundary extends Component { @@ -43,33 +39,7 @@ describe('ErrorBoundary', () => { consoleSpy.mockRestore(); }); - it('sends error details via postMessage', () => { - // Suppress console.error for this test - const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); - postMessageMock.mockClear(); - render( - - - - ); - - expect(postMessageMock).toHaveBeenCalledWith( - expect.objectContaining({ - type: 'mkstack-error', - error: expect.objectContaining({ - message: 'Test error', - stack: expect.any(String), - url: expect.any(String), - timestamp: expect.any(String), - userAgent: expect.any(String), - }), - }), - '*' - ); - - consoleSpy.mockRestore(); - }); it('uses custom fallback when provided', () => { const customFallback =
Custom error message
;