1
1
import type { Integration , Options } from '@sentry/types' ;
2
2
import { logger } from '@sentry/utils' ;
3
+ import { getCurrentScope } from '../../src/currentScopes' ;
3
4
4
- import { Hub , makeMain } from '../../src/hub' ;
5
5
import {
6
6
addIntegration ,
7
7
convertIntegrationFnToClass ,
8
8
getIntegrationsToSetup ,
9
9
installedIntegrations ,
10
10
setupIntegration ,
11
11
} from '../../src/integration' ;
12
+ import { setCurrentClient } from '../../src/sdk' ;
12
13
import { TestClient , getDefaultTestClientOptions } from '../mocks/client' ;
13
14
14
15
function getTestClient ( ) : TestClient {
@@ -617,10 +618,7 @@ describe('addIntegration', () => {
617
618
}
618
619
619
620
const client = getTestClient ( ) ;
620
- // eslint-disable-next-line deprecation/deprecation
621
- const hub = new Hub ( client ) ;
622
- // eslint-disable-next-line deprecation/deprecation
623
- makeMain ( hub ) ;
621
+ setCurrentClient ( client ) ;
624
622
625
623
const integration = new CustomIntegration ( ) ;
626
624
addIntegration ( integration ) ;
@@ -636,10 +634,7 @@ describe('addIntegration', () => {
636
634
setupOnce = jest . fn ( ) ;
637
635
}
638
636
639
- // eslint-disable-next-line deprecation/deprecation
640
- const hub = new Hub ( ) ;
641
- // eslint-disable-next-line deprecation/deprecation
642
- makeMain ( hub ) ;
637
+ getCurrentScope ( ) . setClient ( undefined ) ;
643
638
644
639
const integration = new CustomIntegration ( ) ;
645
640
addIntegration ( integration ) ;
@@ -662,10 +657,8 @@ describe('addIntegration', () => {
662
657
}
663
658
664
659
const client = getTestClient ( ) ;
665
- // eslint-disable-next-line deprecation/deprecation
666
- const hub = new Hub ( client ) ;
667
- // eslint-disable-next-line deprecation/deprecation
668
- makeMain ( hub ) ;
660
+ setCurrentClient ( client ) ;
661
+ client . init ( ) ;
669
662
670
663
const integration = new CustomIntegration ( ) ;
671
664
addIntegration ( integration ) ;
@@ -686,10 +679,8 @@ describe('addIntegration', () => {
686
679
}
687
680
688
681
const client = getTestClient ( ) ;
689
- // eslint-disable-next-line deprecation/deprecation
690
- const hub = new Hub ( client ) ;
691
- // eslint-disable-next-line deprecation/deprecation
692
- makeMain ( hub ) ;
682
+ setCurrentClient ( client ) ;
683
+ client . init ( ) ;
693
684
694
685
const integration1 = new CustomIntegration ( ) ;
695
686
const integration2 = new CustomIntegration ( ) ;
0 commit comments