try fix
Some checks failed
it-academy/dry-wash-pl/pipeline/head There was a failure building this commit

This commit is contained in:
Primakov Alexandr Alexandrovich 2025-02-20 13:31:58 +03:00
parent 253e3b3856
commit 69251745fa
3 changed files with 9 additions and 4 deletions

2
Jenkinsfile vendored
View File

@ -1,7 +1,7 @@
pipeline { pipeline {
agent { agent {
docker { docker {
image 'node:20' image 'node:22'
} }
} }

View File

@ -28,7 +28,6 @@ class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
componentDidCatch(error: Error, errorInfo: ErrorInfo): void { componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
console.error('Error caught by ErrorBoundary:', error, errorInfo); console.error('Error caught by ErrorBoundary:', error, errorInfo);
console.error('4545');
this.setState({ error, errorInfo }); this.setState({ error, errorInfo });
} }

View File

@ -22,8 +22,12 @@ jest.mock('@brojs/cli', () => {
}; };
}); });
describe.skip('ErrorBoundary', () => { describe('ErrorBoundary', () => {
it('должен отобразить запасной UI при ошибке', async () => { it('должен отобразить запасной UI при ошибке', async () => {
// Подавляем вывод ошибки в консоль во время теста
const consoleSpy = jest.spyOn(console, 'error');
consoleSpy.mockImplementation(() => {});
const { container } = render( const { container } = render(
<Provider store={store}> <Provider store={store}>
<ErrorBoundary> <ErrorBoundary>
@ -39,7 +43,9 @@ describe.skip('ErrorBoundary', () => {
); );
expect(button).not.toBeNull(); expect(button).not.toBeNull();
expect(container).toMatchSnapshot(); expect(container).toMatchSnapshot();
// Восстанавливаем console.error после теста
consoleSpy.mockRestore();
}); });
}); });