77 convertIntegrationFnToClass ,
88 getIntegrationsToSetup ,
99 installedIntegrations ,
10- makeIntegrationFn ,
1110 setupIntegration ,
1211} from '../../src/integration' ;
1312import { TestClient , getDefaultTestClientOptions } from '../mocks/client' ;
@@ -655,75 +654,12 @@ describe('addIntegration', () => {
655654 } ) ;
656655} ) ;
657656
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 ( ) ;
698657
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- } ) ;
722658
723659describe ( 'convertIntegrationFnToClass' , ( ) => {
724660 /* eslint-disable deprecation/deprecation */
725661 it ( 'works with a minimal integration' , ( ) => {
726- const integrationFn = makeIntegrationFn ( ( ) => ( { name : 'testName' } ) ) ;
662+ const integrationFn = ( ) => ( { name : 'testName' } ) ;
727663
728664 const IntegrationClass = convertIntegrationFnToClass ( 'testName' , integrationFn ) ;
729665
@@ -742,15 +678,15 @@ describe('convertIntegrationFnToClass', () => {
742678 const processEvent = jest . fn ( ) ;
743679 const preprocessEvent = jest . fn ( ) ;
744680
745- const integrationFn = makeIntegrationFn ( ( ) => {
681+ const integrationFn = ( ) => {
746682 return {
747683 name : 'testName' ,
748684 setup,
749685 setupOnce,
750686 processEvent,
751687 preprocessEvent,
752688 } ;
753- } ) ;
689+ } ;
754690
755691 const IntegrationClass = convertIntegrationFnToClass ( 'testName' , integrationFn ) ;
756692
0 commit comments