File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1- import { init as reactInitRaw , SDK_VERSION } from '@sentry/react' ;
1+ import { init , SDK_VERSION } from '@sentry/react' ;
22import { Integrations } from '@sentry/tracing' ;
33import { Integration } from '@sentry/types' ;
44
55import { init as gatsbyInit } from '../src/sdk' ;
66import { UserIntegrations } from '../src/utils/integrations' ;
77import { GatsbyOptions } from '../src/utils/types' ;
88
9- const reactInit = reactInitRaw as jest . Mock ;
10- jest . mock ( '@sentry/react' ) ;
9+ jest . mock ( '@sentry/react' , ( ) => {
10+ const actual = jest . requireActual ( '@sentry/react' ) ;
11+ return {
12+ ...actual ,
13+ init : jest . fn ( ) . mockImplementation ( actual . init ) ,
14+ } ;
15+ } ) ;
16+
17+ const reactInit = init as jest . Mock ;
1118
1219describe ( 'Initialize React SDK' , ( ) => {
1320 afterEach ( ( ) => reactInit . mockReset ( ) ) ;
You can’t perform that action at this time.
0 commit comments