@@ -1471,18 +1471,6 @@ describe('BaseClient', () => {
1471
1471
global . __SENTRY__ = { } ;
1472
1472
} ) ;
1473
1473
1474
- test ( 'sets up each integration on `setupIntegrations` call' , ( ) => {
1475
- expect . assertions ( 2 ) ;
1476
-
1477
- const options = getDefaultTestClientOptions ( { dsn : PUBLIC_DSN , integrations : [ new TestIntegration ( ) ] } ) ;
1478
- const client = new TestClient ( options ) ;
1479
- // eslint-disable-next-line deprecation/deprecation
1480
- client . setupIntegrations ( ) ;
1481
-
1482
- expect ( Object . keys ( ( client as any ) . _integrations ) . length ) . toEqual ( 1 ) ;
1483
- expect ( client . getIntegrationByName ( TestIntegration . id ) ) . toBeTruthy ( ) ;
1484
- } ) ;
1485
-
1486
1474
test ( 'sets up each integration on `init` call' , ( ) => {
1487
1475
expect . assertions ( 2 ) ;
1488
1476
@@ -1494,18 +1482,6 @@ describe('BaseClient', () => {
1494
1482
expect ( client . getIntegrationByName ( TestIntegration . id ) ) . toBeTruthy ( ) ;
1495
1483
} ) ;
1496
1484
1497
- test ( 'skips installation for `setupIntegrations()` if DSN is not provided' , ( ) => {
1498
- expect . assertions ( 2 ) ;
1499
-
1500
- const options = getDefaultTestClientOptions ( { integrations : [ new TestIntegration ( ) ] } ) ;
1501
- const client = new TestClient ( options ) ;
1502
- // eslint-disable-next-line deprecation/deprecation
1503
- client . setupIntegrations ( ) ;
1504
-
1505
- expect ( Object . keys ( ( client as any ) . _integrations ) . length ) . toEqual ( 0 ) ;
1506
- expect ( client . getIntegrationByName ( TestIntegration . id ) ) . toBeFalsy ( ) ;
1507
- } ) ;
1508
-
1509
1485
test ( 'skips installation for `init()` if DSN is not provided' , ( ) => {
1510
1486
expect . assertions ( 2 ) ;
1511
1487
@@ -1517,22 +1493,6 @@ describe('BaseClient', () => {
1517
1493
expect ( client . getIntegrationByName ( TestIntegration . id ) ) . toBeFalsy ( ) ;
1518
1494
} ) ;
1519
1495
1520
- test ( 'skips installation for `setupIntegrations()` if `enabled` is set to `false`' , ( ) => {
1521
- expect . assertions ( 2 ) ;
1522
-
1523
- const options = getDefaultTestClientOptions ( {
1524
- dsn : PUBLIC_DSN ,
1525
- enabled : false ,
1526
- integrations : [ new TestIntegration ( ) ] ,
1527
- } ) ;
1528
- const client = new TestClient ( options ) ;
1529
- // eslint-disable-next-line deprecation/deprecation
1530
- client . setupIntegrations ( ) ;
1531
-
1532
- expect ( Object . keys ( ( client as any ) . _integrations ) . length ) . toEqual ( 0 ) ;
1533
- expect ( client . getIntegrationByName ( TestIntegration . id ) ) . toBeFalsy ( ) ;
1534
- } ) ;
1535
-
1536
1496
test ( 'skips installation for `init()` if `enabled` is set to `false`' , ( ) => {
1537
1497
expect . assertions ( 2 ) ;
1538
1498
@@ -1548,29 +1508,6 @@ describe('BaseClient', () => {
1548
1508
expect ( client . getIntegrationByName ( TestIntegration . id ) ) . toBeFalsy ( ) ;
1549
1509
} ) ;
1550
1510
1551
- test ( 'skips installation if integrations are already installed' , ( ) => {
1552
- expect . assertions ( 4 ) ;
1553
-
1554
- const options = getDefaultTestClientOptions ( { dsn : PUBLIC_DSN , integrations : [ new TestIntegration ( ) ] } ) ;
1555
- const client = new TestClient ( options ) ;
1556
- // note: not the `Client` method `setupIntegrations`, but the free-standing function which that method calls
1557
- const setupIntegrationsHelper = jest . spyOn ( integrationModule , 'setupIntegrations' ) ;
1558
-
1559
- // it should install the first time, because integrations aren't yet installed...
1560
- // eslint-disable-next-line deprecation/deprecation
1561
- client . setupIntegrations ( ) ;
1562
-
1563
- expect ( Object . keys ( ( client as any ) . _integrations ) . length ) . toEqual ( 1 ) ;
1564
- expect ( client . getIntegrationByName ( TestIntegration . id ) ) . toBeTruthy ( ) ;
1565
- expect ( setupIntegrationsHelper ) . toHaveBeenCalledTimes ( 1 ) ;
1566
-
1567
- // ...but it shouldn't try to install a second time
1568
- // eslint-disable-next-line deprecation/deprecation
1569
- client . setupIntegrations ( ) ;
1570
-
1571
- expect ( setupIntegrationsHelper ) . toHaveBeenCalledTimes ( 1 ) ;
1572
- } ) ;
1573
-
1574
1511
test ( 'does not add integrations twice when calling `init` multiple times' , ( ) => {
1575
1512
const options = getDefaultTestClientOptions ( { dsn : PUBLIC_DSN , integrations : [ new TestIntegration ( ) ] } ) ;
1576
1513
const client = new TestClient ( options ) ;
0 commit comments