@@ -130,7 +130,7 @@ describe('Hono Cloudflare Middleware', () => {
130130 const honoIntegration = { name : 'Hono' } as SentryCore . Integration ;
131131 const otherIntegration = { name : 'Other' } as SentryCore . Integration ;
132132
133- const getIntegrationsResult = ( ) : SentryCore . Integration [ ] => {
133+ const getIntegrationsResult = ( ) => {
134134 const optionsCallback = withSentryMock . mock . calls [ 0 ] ?. [ 0 ] ;
135135 return optionsCallback ( ) . integrations ;
136136 } ;
@@ -143,7 +143,18 @@ describe('Hono Cloudflare Middleware', () => {
143143 const app = new Hono ( ) ;
144144 sentry ( app , { integrations : input } ) ;
145145
146- expect ( getIntegrationsResult ( ) ) . toEqual ( expected ) ;
146+ const integrationsFn = getIntegrationsResult ( ) as ( defaults : SentryCore . Integration [ ] ) => SentryCore . Integration [ ] ;
147+ expect ( integrationsFn ( [ ] ) ) . toEqual ( expected ) ;
148+ } ) ;
149+
150+ it ( 'filters Hono from defaults when user provides an array' , ( ) => {
151+ const app = new Hono ( ) ;
152+ sentry ( app , { integrations : [ otherIntegration ] } ) ;
153+
154+ const integrationsFn = getIntegrationsResult ( ) as ( defaults : SentryCore . Integration [ ] ) => SentryCore . Integration [ ] ;
155+ // Simulates getIntegrationsToSetup: defaults (from Cloudflare) include Hono; result must exclude it
156+ const defaultsWithHono = [ honoIntegration , otherIntegration ] ;
157+ expect ( integrationsFn ( defaultsWithHono ) ) . toEqual ( [ otherIntegration , otherIntegration ] ) ;
147158 } ) ;
148159
149160 it ( 'filters Hono integration out of a function result' , ( ) => {
0 commit comments