From ba8461c2810296f0e695c9e5545df340e9db47b1 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 6 Jan 2019 16:42:14 -0500 Subject: [PATCH] More realistic faking of setState to improve coverage --- src/components/SentryBoundary/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SentryBoundary/test.js b/src/components/SentryBoundary/test.js index e654e22..76a48bc 100644 --- a/src/components/SentryBoundary/test.js +++ b/src/components/SentryBoundary/test.js @@ -29,7 +29,7 @@ describe('SentryBoundary', () => { component.find('Child').simulateError(error); // NOTE: Enzyme doesn't call getDerivedStateFromError yet, so we have to // set the state manually - component.setState({ hasError: true }); + component.setState(SentryBoundary.getDerivedStateFromError(error)); expect(Sentry.captureException).toHaveBeenCalledWith( error,