1- import { logger } from '@sentry/core' ;
1+ import { debug } from '@sentry/core' ;
22import { beforeEach , describe , expect , it , vi } from 'vitest' ;
33import { _clampSpanProcessorTimeout } from '../../src/sdk/initOtel' ;
44
@@ -8,71 +8,71 @@ describe('_clampSpanProcessorTimeout', () => {
88 } ) ;
99
1010 it ( 'works with undefined' , ( ) => {
11- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
11+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
1212 const timeout = _clampSpanProcessorTimeout ( undefined ) ;
1313 expect ( timeout ) . toBe ( undefined ) ;
14- expect ( loggerWarnSpy ) . not . toHaveBeenCalled ( ) ;
14+ expect ( debugWarnSpy ) . not . toHaveBeenCalled ( ) ;
1515 } ) ;
1616
1717 it ( 'works with positive number' , ( ) => {
18- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
18+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
1919 const timeout = _clampSpanProcessorTimeout ( 10 ) ;
2020 expect ( timeout ) . toBe ( 10 ) ;
21- expect ( loggerWarnSpy ) . not . toHaveBeenCalled ( ) ;
21+ expect ( debugWarnSpy ) . not . toHaveBeenCalled ( ) ;
2222 } ) ;
2323
2424 it ( 'works with 0' , ( ) => {
25- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
25+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
2626 const timeout = _clampSpanProcessorTimeout ( 0 ) ;
2727 expect ( timeout ) . toBe ( undefined ) ;
28- expect ( loggerWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
29- expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
28+ expect ( debugWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
29+ expect ( debugWarnSpy ) . toHaveBeenCalledWith (
3030 '`maxSpanWaitDuration` must be a positive number, using default value instead.' ,
3131 ) ;
3232 } ) ;
3333
3434 it ( 'works with negative number' , ( ) => {
35- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
35+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
3636 const timeout = _clampSpanProcessorTimeout ( - 10 ) ;
3737 expect ( timeout ) . toBe ( undefined ) ;
38- expect ( loggerWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
39- expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
38+ expect ( debugWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
39+ expect ( debugWarnSpy ) . toHaveBeenCalledWith (
4040 '`maxSpanWaitDuration` must be a positive number, using default value instead.' ,
4141 ) ;
4242 } ) ;
4343
4444 it ( 'works with -Infinity' , ( ) => {
45- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
45+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
4646 const timeout = _clampSpanProcessorTimeout ( - Infinity ) ;
4747 expect ( timeout ) . toBe ( undefined ) ;
48- expect ( loggerWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
49- expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
48+ expect ( debugWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
49+ expect ( debugWarnSpy ) . toHaveBeenCalledWith (
5050 '`maxSpanWaitDuration` must be a positive number, using default value instead.' ,
5151 ) ;
5252 } ) ;
5353
5454 it ( 'works with Infinity' , ( ) => {
55- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
55+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
5656 const timeout = _clampSpanProcessorTimeout ( Infinity ) ;
5757 expect ( timeout ) . toBe ( 1_000_000 ) ;
58- expect ( loggerWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
59- expect ( loggerWarnSpy ) . toHaveBeenCalledWith ( '`maxSpanWaitDuration` is too high, using the maximum value of 1000000' ) ;
58+ expect ( debugWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
59+ expect ( debugWarnSpy ) . toHaveBeenCalledWith ( '`maxSpanWaitDuration` is too high, using the maximum value of 1000000' ) ;
6060 } ) ;
6161
6262 it ( 'works with large number' , ( ) => {
63- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
63+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
6464 const timeout = _clampSpanProcessorTimeout ( 1_000_000_000 ) ;
6565 expect ( timeout ) . toBe ( 1_000_000 ) ;
66- expect ( loggerWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
67- expect ( loggerWarnSpy ) . toHaveBeenCalledWith ( '`maxSpanWaitDuration` is too high, using the maximum value of 1000000' ) ;
66+ expect ( debugWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
67+ expect ( debugWarnSpy ) . toHaveBeenCalledWith ( '`maxSpanWaitDuration` is too high, using the maximum value of 1000000' ) ;
6868 } ) ;
6969
7070 it ( 'works with NaN' , ( ) => {
71- const loggerWarnSpy = vi . spyOn ( logger , 'warn' ) . mockImplementation ( ( ) => { } ) ;
71+ const debugWarnSpy = vi . spyOn ( debug , 'warn' ) . mockImplementation ( ( ) => { } ) ;
7272 const timeout = _clampSpanProcessorTimeout ( NaN ) ;
7373 expect ( timeout ) . toBe ( undefined ) ;
74- expect ( loggerWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
75- expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
74+ expect ( debugWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
75+ expect ( debugWarnSpy ) . toHaveBeenCalledWith (
7676 '`maxSpanWaitDuration` must be a positive number, using default value instead.' ,
7777 ) ;
7878 } ) ;
0 commit comments