@@ -62,18 +62,18 @@ describe('Hono Node Middleware', () => {
6262 expect ( middleware . constructor . name ) . toBe ( 'AsyncFunction' ) ;
6363 } ) ;
6464
65- it ( 'emits a warning when Sentry is not initialized' , ( ) => {
66- const warnSpy = vi . spyOn ( SentryCore . debug , 'warn' ) ;
65+ it ( 'emits a console.warn when Sentry is not initialized' , ( ) => {
66+ const consoleWarnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => undefined ) ;
6767 vi . spyOn ( SentryCore , 'getClient' ) . mockReturnValue ( undefined ) ;
6868
6969 const app = new Hono ( ) ;
7070 sentry ( app ) ;
7171
72- expect ( warnSpy ) . toHaveBeenCalledWith ( expect . stringContaining ( 'Sentry is not initialized' ) ) ;
72+ expect ( consoleWarnSpy ) . toHaveBeenCalledWith ( expect . stringContaining ( 'Sentry is not initialized' ) ) ;
73+ consoleWarnSpy . mockRestore ( ) ;
7374 } ) ;
7475
7576 it ( 'does not emit a warning when Sentry is already initialized with @sentry/hono/node' , ( ) => {
76- const warnSpy = vi . spyOn ( SentryCore . debug , 'warn' ) ;
7777 const consoleWarnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => undefined ) ;
7878 const fakeClient = {
7979 getOptions : ( ) => ( {
@@ -86,7 +86,6 @@ describe('Hono Node Middleware', () => {
8686 const app = new Hono ( ) ;
8787 sentry ( app ) ;
8888
89- expect ( warnSpy ) . not . toHaveBeenCalled ( ) ;
9089 expect ( consoleWarnSpy ) . not . toHaveBeenCalled ( ) ;
9190 consoleWarnSpy . mockRestore ( ) ;
9291 } ) ;
@@ -172,18 +171,18 @@ describe('Hono Node Middleware', () => {
172171 expect ( middleware . constructor . name ) . toBe ( 'AsyncFunction' ) ;
173172 } ) ;
174173
175- it ( 'emits a warning when Sentry is not initialized' , ( ) => {
176- const warnSpy = vi . spyOn ( SentryCore . debug , 'warn' ) ;
174+ it ( 'emits a console.warn when Sentry is not initialized' , ( ) => {
175+ const consoleWarnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => undefined ) ;
177176 vi . spyOn ( SentryCore , 'getClient' ) . mockReturnValue ( undefined ) ;
178177
179178 const app = new Hono ( ) ;
180179 sentry ( app ) ;
181180
182- expect ( warnSpy ) . toHaveBeenCalledWith ( expect . stringContaining ( 'Sentry is not initialized' ) ) ;
181+ expect ( consoleWarnSpy ) . toHaveBeenCalledWith ( expect . stringContaining ( 'Sentry is not initialized' ) ) ;
182+ consoleWarnSpy . mockRestore ( ) ;
183183 } ) ;
184184
185185 it ( 'does not emit a warning when Sentry is already initialized with @sentry/hono/node' , ( ) => {
186- const warnSpy = vi . spyOn ( SentryCore . debug , 'warn' ) ;
187186 const consoleWarnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => undefined ) ;
188187 const fakeClient = {
189188 getOptions : ( ) => ( {
@@ -196,7 +195,6 @@ describe('Hono Node Middleware', () => {
196195 const app = new Hono ( ) ;
197196 const middleware = sentry ( app ) ;
198197
199- expect ( warnSpy ) . not . toHaveBeenCalled ( ) ;
200198 expect ( consoleWarnSpy ) . not . toHaveBeenCalled ( ) ;
201199 expect ( middleware . constructor . name ) . toBe ( 'AsyncFunction' ) ;
202200 consoleWarnSpy . mockRestore ( ) ;
0 commit comments