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 {
agent {
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 {
console.error('Error caught by ErrorBoundary:', error, errorInfo);
console.error('4545');
this.setState({ error, errorInfo });
}

View File

@ -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(
<Provider store={store}>
<ErrorBoundary>
@ -39,7 +43,9 @@ describe.skip('ErrorBoundary', () => {
);
expect(button).not.toBeNull();
expect(container).toMatchSnapshot();
// Восстанавливаем console.error после теста
consoleSpy.mockRestore();
});
});