Updating tests for SentryBoundary

This commit is contained in:
Jeff Avallone 2019-01-12 13:36:09 -05:00
parent d8ceec1c07
commit 2d754227b1

View File

@ -31,9 +31,11 @@ describe('SentryBoundary', () => {
// set the state manually // set the state manually
component.setState(SentryBoundary.getDerivedStateFromError(error)); component.setState(SentryBoundary.getDerivedStateFromError(error));
expect(Sentry.captureException).toHaveBeenCalledWith( const scope = { setExtra: jest.fn() };
error, expect(Sentry.withScope).toHaveBeenCalled();
expect.anything());
Sentry.withScope.mock.calls[0][0](scope);
expect(Sentry.captureException).toHaveBeenCalledWith(error);
expect(component).toMatchSnapshot(); expect(component).toMatchSnapshot();
}); });
}); });