@@ -345,6 +345,7 @@ describe('SmartTransactionsController', () => {
345345 const captureExceptionSpy = jest . fn ( ) ;
346346 const rootMessenger : RootMessenger = new Messenger ( {
347347 namespace : MOCK_ANY_NAMESPACE ,
348+ captureException : captureExceptionSpy ,
348349 } ) ;
349350
350351 rootMessenger . registerActionHandler (
@@ -381,10 +382,6 @@ describe('SmartTransactionsController', () => {
381382 } ,
382383 } ) ,
383384 ) ;
384- rootMessenger . registerActionHandler (
385- 'ErrorReportingService:captureException' ,
386- captureExceptionSpy ,
387- ) ;
388385
389386 const messenger = new Messenger <
390387 'SmartTransactionsController' ,
@@ -404,7 +401,6 @@ describe('SmartTransactionsController', () => {
404401 'TransactionController:getNonceLock' ,
405402 'TransactionController:getTransactions' ,
406403 'TransactionController:updateTransaction' ,
407- 'ErrorReportingService:captureException' ,
408404 ] ,
409405 events : [
410406 'NetworkController:stateChange' ,
@@ -451,6 +447,7 @@ describe('SmartTransactionsController', () => {
451447 const captureExceptionSpy = jest . fn ( ) ;
452448 const rootMessenger : RootMessenger = new Messenger ( {
453449 namespace : MOCK_ANY_NAMESPACE ,
450+ captureException : captureExceptionSpy ,
454451 } ) ;
455452
456453 rootMessenger . registerActionHandler (
@@ -489,10 +486,6 @@ describe('SmartTransactionsController', () => {
489486 } ,
490487 } ) ,
491488 ) ;
492- rootMessenger . registerActionHandler (
493- 'ErrorReportingService:captureException' ,
494- captureExceptionSpy ,
495- ) ;
496489
497490 const messenger = new Messenger <
498491 'SmartTransactionsController' ,
@@ -512,7 +505,6 @@ describe('SmartTransactionsController', () => {
512505 'TransactionController:getNonceLock' ,
513506 'TransactionController:getTransactions' ,
514507 'TransactionController:updateTransaction' ,
515- 'ErrorReportingService:captureException' ,
516508 ] ,
517509 events : [
518510 'NetworkController:stateChange' ,
@@ -555,6 +547,7 @@ describe('SmartTransactionsController', () => {
555547 const captureExceptionSpy = jest . fn ( ) ;
556548 const rootMessenger : RootMessenger = new Messenger ( {
557549 namespace : MOCK_ANY_NAMESPACE ,
550+ captureException : captureExceptionSpy ,
558551 } ) ;
559552
560553 rootMessenger . registerActionHandler (
@@ -591,10 +584,6 @@ describe('SmartTransactionsController', () => {
591584 } ,
592585 } ) ,
593586 ) ;
594- rootMessenger . registerActionHandler (
595- 'ErrorReportingService:captureException' ,
596- captureExceptionSpy ,
597- ) ;
598587
599588 const messenger = new Messenger <
600589 'SmartTransactionsController' ,
@@ -614,7 +603,6 @@ describe('SmartTransactionsController', () => {
614603 'TransactionController:getNonceLock' ,
615604 'TransactionController:getTransactions' ,
616605 'TransactionController:updateTransaction' ,
617- 'ErrorReportingService:captureException' ,
618606 ] ,
619607 events : [
620608 'NetworkController:stateChange' ,
@@ -658,16 +646,17 @@ describe('SmartTransactionsController', () => {
658646 } ) ;
659647
660648 it ( 'reports error to ErrorReportingService when feature flags become invalid after state change' , async ( ) => {
661- const captureExceptionSpy = jest . fn ( ) ;
662649 const getStateMock = jest . fn ( ) . mockReturnValue ( {
663650 remoteFeatureFlags : {
664651 smartTransactionsNetworks : {
665652 default : { extensionActive : true } ,
666653 } ,
667654 } ,
668655 } ) ;
656+ const captureExceptionSpy = jest . fn ( ) ;
669657 const rootMessenger : RootMessenger = new Messenger ( {
670658 namespace : MOCK_ANY_NAMESPACE ,
659+ captureException : captureExceptionSpy ,
671660 } ) ;
672661
673662 rootMessenger . registerActionHandler (
@@ -700,10 +689,6 @@ describe('SmartTransactionsController', () => {
700689 'RemoteFeatureFlagController:getState' ,
701690 getStateMock ,
702691 ) ;
703- rootMessenger . registerActionHandler (
704- 'ErrorReportingService:captureException' ,
705- captureExceptionSpy ,
706- ) ;
707692
708693 const messenger = new Messenger <
709694 'SmartTransactionsController' ,
@@ -723,7 +708,6 @@ describe('SmartTransactionsController', () => {
723708 'TransactionController:getNonceLock' ,
724709 'TransactionController:getTransactions' ,
725710 'TransactionController:updateTransaction' ,
726- 'ErrorReportingService:captureException' ,
727711 ] ,
728712 events : [
729713 'NetworkController:stateChange' ,
@@ -776,6 +760,7 @@ describe('SmartTransactionsController', () => {
776760 const captureExceptionSpy = jest . fn ( ) ;
777761 const rootMessenger : RootMessenger = new Messenger ( {
778762 namespace : MOCK_ANY_NAMESPACE ,
763+ captureException : captureExceptionSpy ,
779764 } ) ;
780765
781766 rootMessenger . registerActionHandler (
@@ -817,10 +802,6 @@ describe('SmartTransactionsController', () => {
817802 } ,
818803 } ) ,
819804 ) ;
820- rootMessenger . registerActionHandler (
821- 'ErrorReportingService:captureException' ,
822- captureExceptionSpy ,
823- ) ;
824805
825806 const messenger = new Messenger <
826807 'SmartTransactionsController' ,
@@ -840,7 +821,6 @@ describe('SmartTransactionsController', () => {
840821 'TransactionController:getNonceLock' ,
841822 'TransactionController:getTransactions' ,
842823 'TransactionController:updateTransaction' ,
843- 'ErrorReportingService:captureException' ,
844824 ] ,
845825 events : [
846826 'NetworkController:stateChange' ,
@@ -3259,6 +3239,7 @@ async function withController<ReturnValue>(
32593239
32603240 const rootMessenger : RootMessenger = new Messenger ( {
32613241 namespace : MOCK_ANY_NAMESPACE ,
3242+ captureException : jest . fn ( ) ,
32623243 } ) ;
32633244 rootMessenger . registerActionHandler (
32643245 'NetworkController:getNetworkClientById' ,
@@ -3339,10 +3320,6 @@ async function withController<ReturnValue>(
33393320 remoteFeatureFlags,
33403321 } ) ,
33413322 ) ;
3342- rootMessenger . registerActionHandler (
3343- 'ErrorReportingService:captureException' ,
3344- jest . fn ( ) ,
3345- ) ;
33463323
33473324 const messenger = new Messenger <
33483325 'SmartTransactionsController' ,
@@ -3362,7 +3339,6 @@ async function withController<ReturnValue>(
33623339 'TransactionController:getNonceLock' ,
33633340 'TransactionController:getTransactions' ,
33643341 'TransactionController:updateTransaction' ,
3365- 'ErrorReportingService:captureException' ,
33663342 ] ,
33673343 events : [
33683344 'NetworkController:stateChange' ,
0 commit comments