File tree 1 file changed +10
-3
lines changed
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' ;
2
2
import { Integrations } from '@sentry/tracing' ;
3
3
import { Integration } from '@sentry/types' ;
4
4
5
5
import { init as gatsbyInit } from '../src/sdk' ;
6
6
import { UserIntegrations } from '../src/utils/integrations' ;
7
7
import { GatsbyOptions } from '../src/utils/types' ;
8
8
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 ;
11
18
12
19
describe ( 'Initialize React SDK' , ( ) => {
13
20
afterEach ( ( ) => reactInit . mockReset ( ) ) ;
You can’t perform that action at this time.
0 commit comments