Updating tests for SentryBoundary

This commit is contained in:
Jeff Avallone 2019-01-12 13:36:09 -05:00
parent d8ceec1c07
commit 2d754227b1
1 changed files with 5 additions and 3 deletions

View File

@ -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();
});
});