@@ -789,40 +789,51 @@ describe('StripeSource', () => {
789789 } )
790790 } )
791791
792- it ( 'marks known skippable Stripe list errors as complete without emitting error traces' , async ( ) => {
793- const listFn = vi
794- . fn ( )
795- . mockRejectedValueOnce ( new Error ( 'This object is only available in testmode' ) )
796-
797- const registry : Record < string , ResourceConfig > = {
798- invoices : makeConfig ( {
799- order : 1 ,
800- tableName : 'invoices' ,
801- listFn : listFn as ResourceConfig [ 'listFn' ] ,
802- } ) ,
803- }
792+ it . each ( [
793+ [ 'testmode-only resource' , 'This object is only available in testmode' ] ,
794+ [
795+ 'v2 core accounts in test mode' ,
796+ "Accounts v2 isn't available in test mode. Switch to a sandbox to test. [GET /v2/core/accounts (400)] {request-id=req_x, stripe-should-retry=false}" ,
797+ ] ,
798+ [
799+ 'sigma scheduled_query_runs testmode' ,
800+ 'This API surface is not enabled for testmode usage. [GET /v1/sigma/scheduled_query_runs (400)] {request-id=req_y}' ,
801+ ] ,
802+ ] ) (
803+ 'marks known skippable Stripe list errors as complete without emitting error traces (%s)' ,
804+ async ( _label , errorMessage ) => {
805+ const listFn = vi . fn ( ) . mockRejectedValueOnce ( new Error ( errorMessage ) )
806+
807+ const registry : Record < string , ResourceConfig > = {
808+ invoices : makeConfig ( {
809+ order : 1 ,
810+ tableName : 'invoices' ,
811+ listFn : listFn as ResourceConfig [ 'listFn' ] ,
812+ } ) ,
813+ }
804814
805- vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
806- const messages = await collect (
807- source . read ( { config, catalog : catalog ( { name : 'invoices' , primary_key : [ [ 'id' ] ] } ) } )
808- )
815+ vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
816+ const messages = await collect (
817+ source . read ( { config, catalog : catalog ( { name : 'invoices' , primary_key : [ [ 'id' ] ] } ) } )
818+ )
809819
810- expect ( messages ) . toHaveLength ( 2 )
811- expect ( messages [ 0 ] ) . toMatchObject ( {
812- type : 'trace' ,
813- trace : {
814- trace_type : 'stream_status' ,
815- stream_status : { stream : 'invoices' , status : 'started' } ,
816- } ,
817- } )
818- expect ( messages [ 1 ] ) . toMatchObject ( {
819- type : 'trace' ,
820- trace : {
821- trace_type : 'stream_status' ,
822- stream_status : { stream : 'invoices' , status : 'complete' } ,
823- } ,
824- } )
825- } )
820+ expect ( messages ) . toHaveLength ( 2 )
821+ expect ( messages [ 0 ] ) . toMatchObject ( {
822+ type : 'trace' ,
823+ trace : {
824+ trace_type : 'stream_status' ,
825+ stream_status : { stream : 'invoices' , status : 'started' } ,
826+ } ,
827+ } )
828+ expect ( messages [ 1 ] ) . toMatchObject ( {
829+ type : 'trace' ,
830+ trace : {
831+ trace_type : 'stream_status' ,
832+ stream_status : { stream : 'invoices' , status : 'complete' } ,
833+ } ,
834+ } )
835+ }
836+ )
826837
827838 it ( 'continues to next stream after error on previous stream' , async ( ) => {
828839 const failingListFn = vi . fn ( ) . mockRejectedValueOnce ( new Error ( 'Connection refused' ) )
0 commit comments