Migrated ErrorHandler test to react testing library

This commit is contained in:
Alejandro Celaya
2022-05-03 20:01:40 +02:00
parent e128b847be
commit bc3bc8dd8a
3 changed files with 31 additions and 27 deletions

View File

@@ -6,10 +6,10 @@ interface ErrorHandlerState {
hasError: boolean;
}
const ErrorHandlerCreator = (
export const ErrorHandler = (
{ location }: Window,
{ error }: Console,
) => class ErrorHandler extends Component<any, ErrorHandlerState> {
) => class extends Component<any, ErrorHandlerState> {
public constructor(props: object) {
super(props);
this.state = { hasError: false };
@@ -44,5 +44,3 @@ const ErrorHandlerCreator = (
return children;
}
};
export default ErrorHandlerCreator;