From 2d754227b121eb22df210d5a169c46a61059eaa3 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 12 Jan 2019 13:36:09 -0500 Subject: [PATCH] Updating tests for SentryBoundary --- src/components/SentryBoundary/test.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/SentryBoundary/test.js b/src/components/SentryBoundary/test.js index 76a48bc..456392e 100644 --- a/src/components/SentryBoundary/test.js +++ b/src/components/SentryBoundary/test.js @@ -31,9 +31,11 @@ describe('SentryBoundary', () => { // set the state manually component.setState(SentryBoundary.getDerivedStateFromError(error)); - expect(Sentry.captureException).toHaveBeenCalledWith( - error, - expect.anything()); + const scope = { setExtra: jest.fn() }; + expect(Sentry.withScope).toHaveBeenCalled(); + + Sentry.withScope.mock.calls[0][0](scope); + expect(Sentry.captureException).toHaveBeenCalledWith(error); expect(component).toMatchSnapshot(); }); });