diff --git a/Jenkinsfile b/Jenkinsfile index 4844afd..8b2235d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { docker { - image 'node:20' + image 'node:22' } } diff --git a/src/components/ErrorBoundary/ErrorBoundary.tsx b/src/components/ErrorBoundary/ErrorBoundary.tsx index d0fc96a..6385951 100644 --- a/src/components/ErrorBoundary/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary/ErrorBoundary.tsx @@ -28,7 +28,6 @@ class ErrorBoundary extends Component { componentDidCatch(error: Error, errorInfo: ErrorInfo): void { console.error('Error caught by ErrorBoundary:', error, errorInfo); - console.error('4545'); this.setState({ error, errorInfo }); } diff --git a/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx b/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx index e35f4ab..db19d52 100644 --- a/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx +++ b/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx @@ -22,8 +22,12 @@ jest.mock('@brojs/cli', () => { }; }); -describe.skip('ErrorBoundary', () => { +describe('ErrorBoundary', () => { it('должен отобразить запасной UI при ошибке', async () => { + // Подавляем вывод ошибки в консоль во время теста + const consoleSpy = jest.spyOn(console, 'error'); + consoleSpy.mockImplementation(() => {}); + const { container } = render( @@ -39,7 +43,9 @@ describe.skip('ErrorBoundary', () => { ); expect(button).not.toBeNull(); - expect(container).toMatchSnapshot(); + + // Восстанавливаем console.error после теста + consoleSpy.mockRestore(); }); });