try fix
Some checks failed
it-academy/dry-wash-pl/pipeline/head There was a failure building this commit
Some checks failed
it-academy/dry-wash-pl/pipeline/head There was a failure building this commit
This commit is contained in:
parent
253e3b3856
commit
69251745fa
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -1,7 +1,7 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'node:20'
|
image 'node:22'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user