11import type { Integration , Options } from '@sentry/types' ;
22import { logger } from '@sentry/utils' ;
3+ import { getCurrentScope } from '../../src/currentScopes' ;
34
4- import { Hub , makeMain } from '../../src/hub' ;
55import {
66 addIntegration ,
77 convertIntegrationFnToClass ,
88 getIntegrationsToSetup ,
99 installedIntegrations ,
1010 setupIntegration ,
1111} from '../../src/integration' ;
12+ import { setCurrentClient } from '../../src/sdk' ;
1213import { TestClient , getDefaultTestClientOptions } from '../mocks/client' ;
1314
1415function getTestClient ( ) : TestClient {
@@ -617,10 +618,7 @@ describe('addIntegration', () => {
617618 }
618619
619620 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 ) ;
624622
625623 const integration = new CustomIntegration ( ) ;
626624 addIntegration ( integration ) ;
@@ -636,10 +634,7 @@ describe('addIntegration', () => {
636634 setupOnce = jest . fn ( ) ;
637635 }
638636
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 ) ;
643638
644639 const integration = new CustomIntegration ( ) ;
645640 addIntegration ( integration ) ;
@@ -662,10 +657,8 @@ describe('addIntegration', () => {
662657 }
663658
664659 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 ( ) ;
669662
670663 const integration = new CustomIntegration ( ) ;
671664 addIntegration ( integration ) ;
@@ -686,10 +679,8 @@ describe('addIntegration', () => {
686679 }
687680
688681 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 ( ) ;
693684
694685 const integration1 = new CustomIntegration ( ) ;
695686 const integration2 = new CustomIntegration ( ) ;
0 commit comments