Skip to content

Commit

Permalink
fix gatsby tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Oct 13, 2022
1 parent a04a2f9 commit 8d89b3a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/gatsby/test/sdk.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { init as reactInitRaw, SDK_VERSION } from '@sentry/react';
import { init, SDK_VERSION } from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import { Integration } from '@sentry/types';

import { init as gatsbyInit } from '../src/sdk';
import { UserIntegrations } from '../src/utils/integrations';
import { GatsbyOptions } from '../src/utils/types';

const reactInit = reactInitRaw as jest.Mock;
jest.mock('@sentry/react');
jest.mock('@sentry/react', () => {
const actual = jest.requireActual('@sentry/react');
return {
...actual,
init: jest.fn().mockImplementation(actual.init),
};
});

const reactInit = init as jest.Mock;

describe('Initialize React SDK', () => {
afterEach(() => reactInit.mockReset());
Expand Down

0 comments on commit 8d89b3a

Please sign in to comment.