@@ -59,7 +59,7 @@ describe('spanStreamingIntegration', () => {
5959 client . init ( ) ;
6060
6161 expect ( debugSpy ) . toHaveBeenCalledWith (
62- 'spanStreamingIntegration requires `traceLifecycle` to be set to "stream"! Falling back to static trace lifecycle.' ,
62+ 'SpanStreaming integration requires `traceLifecycle` to be set to "stream"! Falling back to static trace lifecycle.' ,
6363 ) ;
6464 debugSpy . mockRestore ( ) ;
6565
@@ -80,14 +80,14 @@ describe('spanStreamingIntegration', () => {
8080 client . init ( ) ;
8181
8282 expect ( debugSpy ) . toHaveBeenCalledWith (
83- 'spanStreamingIntegration requires a beforeSendSpan callback using `withStreamSpan `! Falling back to static trace lifecycle.' ,
83+ 'SpanStreaming integration requires a beforeSendSpan callback using `withStreamedSpan `! Falling back to static trace lifecycle.' ,
8484 ) ;
8585 debugSpy . mockRestore ( ) ;
8686
8787 expect ( client . getOptions ( ) . traceLifecycle ) . toBe ( 'static' ) ;
8888 } ) ;
8989
90- it ( 'enqueues a span into the buffer when the span ends ' , ( ) => {
90+ it ( 'does nothing if traceLifecycle set to "stream" ' , ( ) => {
9191 const client = new BrowserClient ( {
9292 ...getDefaultBrowserClientOptions ( ) ,
9393 dsn : 'https://username@domain/123' ,
@@ -98,6 +98,19 @@ describe('spanStreamingIntegration', () => {
9898 SentryCore . setCurrentClient ( client ) ;
9999 client . init ( ) ;
100100
101+ expect ( client . getOptions ( ) . traceLifecycle ) . toBe ( 'stream' ) ;
102+ } ) ;
103+
104+ it ( 'enqueues a span into the buffer when the span ends' , ( ) => {
105+ const client = new BrowserClient ( {
106+ ...getDefaultBrowserClientOptions ( ) ,
107+ dsn : 'https://username@domain/123' ,
108+ integrations : [ spanStreamingIntegration ( ) ] ,
109+ } ) ;
110+
111+ SentryCore . setCurrentClient ( client ) ;
112+ client . init ( ) ;
113+
101114 const span = new SentryCore . SentrySpan ( { name : 'test' } ) ;
102115 client . emit ( 'afterSpanEnd' , span ) ;
103116
0 commit comments