More realistic faking of setState to improve coverage
This commit is contained in:
parent
02f6f2d252
commit
ba8461c281
@ -29,7 +29,7 @@ describe('SentryBoundary', () => {
|
|||||||
component.find('Child').simulateError(error);
|
component.find('Child').simulateError(error);
|
||||||
// NOTE: Enzyme doesn't call getDerivedStateFromError yet, so we have to
|
// NOTE: Enzyme doesn't call getDerivedStateFromError yet, so we have to
|
||||||
// set the state manually
|
// set the state manually
|
||||||
component.setState({ hasError: true });
|
component.setState(SentryBoundary.getDerivedStateFromError(error));
|
||||||
|
|
||||||
expect(Sentry.captureException).toHaveBeenCalledWith(
|
expect(Sentry.captureException).toHaveBeenCalledWith(
|
||||||
error,
|
error,
|
||||||
|
Loading…
Reference in New Issue
Block a user