7
7
convertIntegrationFnToClass ,
8
8
getIntegrationsToSetup ,
9
9
installedIntegrations ,
10
- makeIntegrationFn ,
11
10
setupIntegration ,
12
11
} from '../../src/integration' ;
13
12
import { TestClient , getDefaultTestClientOptions } from '../mocks/client' ;
@@ -655,75 +654,12 @@ describe('addIntegration', () => {
655
654
} ) ;
656
655
} ) ;
657
656
658
- describe ( 'makeIntegrationFn' , ( ) => {
659
- it ( 'works with a minimal integration' , ( ) => {
660
- const myIntegration = makeIntegrationFn ( ( ) => {
661
- return {
662
- name : 'testName'
663
- } ;
664
- } ) ;
665
-
666
- const integration = myIntegration ( ) ;
667
- expect ( integration ) . toEqual ( {
668
- name : 'testName' ,
669
- } ) ;
670
-
671
- // @ts -expect-error This SHOULD error
672
- myIntegration ( { } ) ;
673
- } ) ;
674
-
675
- it ( 'works with integration options' , ( ) => {
676
- const myIntegration = makeIntegrationFn ( ( _options : { xxx : string } ) => {
677
- return {
678
- name : 'testName'
679
- } ;
680
- } ) ;
681
-
682
- const integration = myIntegration ( { xxx : 'aa' } ) ;
683
- expect ( integration ) . toEqual ( {
684
- name : 'testName' ,
685
- } ) ;
686
-
687
- // @ts -expect-error This SHOULD error
688
- myIntegration ( ) ;
689
- // @ts -expect-error This SHOULD error
690
- myIntegration ( { } ) ;
691
- } ) ;
692
-
693
- it ( 'works with integration hooks' , ( ) => {
694
- const setup = jest . fn ( ) ;
695
- const setupOnce = jest . fn ( ) ;
696
- const processEvent = jest . fn ( ) ;
697
- const preprocessEvent = jest . fn ( ) ;
698
657
699
- const myIntegration = makeIntegrationFn ( ( ) => {
700
- return {
701
- name : 'testName' ,
702
- setup,
703
- setupOnce,
704
- processEvent,
705
- preprocessEvent,
706
- } ;
707
- } ) ;
708
-
709
- const integration = myIntegration ( ) ;
710
- expect ( integration ) . toEqual ( {
711
- name : 'testName' ,
712
- setup,
713
- setupOnce,
714
- processEvent,
715
- preprocessEvent,
716
- } ) ;
717
-
718
- // @ts -expect-error This SHOULD error
719
- makeIntegrationFn ( 'testName' , ( ) => ( { other : 'aha' } ) ) ;
720
- } ) ;
721
- } ) ;
722
658
723
659
describe ( 'convertIntegrationFnToClass' , ( ) => {
724
660
/* eslint-disable deprecation/deprecation */
725
661
it ( 'works with a minimal integration' , ( ) => {
726
- const integrationFn = makeIntegrationFn ( ( ) => ( { name : 'testName' } ) ) ;
662
+ const integrationFn = ( ) => ( { name : 'testName' } ) ;
727
663
728
664
const IntegrationClass = convertIntegrationFnToClass ( 'testName' , integrationFn ) ;
729
665
@@ -742,15 +678,15 @@ describe('convertIntegrationFnToClass', () => {
742
678
const processEvent = jest . fn ( ) ;
743
679
const preprocessEvent = jest . fn ( ) ;
744
680
745
- const integrationFn = makeIntegrationFn ( ( ) => {
681
+ const integrationFn = ( ) => {
746
682
return {
747
683
name : 'testName' ,
748
684
setup,
749
685
setupOnce,
750
686
processEvent,
751
687
preprocessEvent,
752
688
} ;
753
- } ) ;
689
+ } ;
754
690
755
691
const IntegrationClass = convertIntegrationFnToClass ( 'testName' , integrationFn ) ;
756
692
0 commit comments