How to use the @commercetools-frontend/sentry.reportErrorToSentry.mockClear function in @commercetools-frontend/sentry

To help you get started, we’ve selected a few @commercetools-frontend/sentry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / packages / application-shell / src / hooks / use-applications-menu / use-applications-menu.spec.js View on Github external
it('should report error to sentry', async () => {
      console.error = jest.fn();
      reportErrorToSentry.mockClear();
      const error = new Error('Oops');
      const { getByText } = renderApp(
        ,
        {
          mocks: [
            {
              request: {
                query: FetchApplicationsMenu,
              },
              error,
            },
          ],
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / application-shell / application-shell.spec.js View on Github external
beforeEach(() => {
        reportErrorToSentry.mockClear();
        props = createTestProps();
        wrapper = shallow()
          .find(FetchUser)
          .renderProp('children')(userData);
      });
      it('should pass "user" to ', () => {
github commercetools / merchant-center-application-kit / src / components / async-locale-messages / async-locale-messages.spec.js View on Github external
beforeEach(() => {
        reportErrorToSentry.mockClear();
        wrapper.instance().componentDidMount();
      });
      it('should report the error to sentry', () => {
github commercetools / merchant-center-application-kit / packages / i18n / src / async-locale-data / async-locale-data.spec.js View on Github external
beforeEach(() => {
        reportErrorToSentry.mockClear();
        wrapper.instance().componentDidMount();
      });
      it('should report the error to sentry', () => {
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / application-shell / application-shell.spec.js View on Github external
beforeEach(() => {
  xhrMock.setup();
  mockSuperfluousRequests();
  window.localStorage.setItem.mockClear();
  window.localStorage.getItem.mockClear();
  window.localStorage.removeItem.mockClear();
  window.location.replace = jest.fn();
  reportErrorToSentry.mockClear();
  selectProjectKeyFromUrl.mockClear();

  window.localStorage.getItem.mockImplementation(key => {
    switch (key) {
      case STORAGE_KEYS.IS_AUTHENTICATED:
        return 'true';
      case STORAGE_KEYS.ACTIVE_PROJECT_KEY:
        return null;
      default:
        return null;
    }
  });
});
afterEach(() => {

@commercetools-frontend/sentry

Components to set up Sentry for a MC application

MIT
Latest version published 3 days ago

Package Health Score

87 / 100
Full package analysis