1- import { SentrySpan } from '@sentry/core' ;
1+ import * as SentryCore from '@sentry/core' ;
22import * as SentryNode from '@sentry/node' ;
33import {
44 createTransport ,
@@ -16,7 +16,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
1616import { withServerActionInstrumentation } from '../../src/server' ;
1717
1818const mockCaptureException = vi . spyOn ( SentryNode , 'captureException' ) . mockImplementation ( ( ) => '' ) ;
19- const mockFlush = vi . spyOn ( SentryNode , 'flush ' ) . mockImplementation ( async ( ) => true ) ;
19+ const mockFlush = vi . spyOn ( SentryCore , 'flushIfServerless ' ) . mockImplementation ( async ( ) => { } ) ;
2020const mockGetActiveSpan = vi . spyOn ( SentryNode , 'getActiveSpan' ) ;
2121
2222const mockGetRequestEvent = vi . fn ( ) ;
@@ -126,7 +126,7 @@ describe('withServerActionInstrumentation', () => {
126126 } ) ;
127127
128128 it ( 'sets a server action name on the active span' , async ( ) => {
129- const span = new SentrySpan ( ) ;
129+ const span = new SentryCore . SentrySpan ( ) ;
130130 span . setAttribute ( 'http.target' , '/_server' ) ;
131131 mockGetActiveSpan . mockReturnValue ( span ) ;
132132 const mockSpanSetAttribute = vi . spyOn ( span , 'setAttribute' ) ;
@@ -145,7 +145,7 @@ describe('withServerActionInstrumentation', () => {
145145 } ) ;
146146
147147 it ( 'does not set a server action name if the active span had a non `/_server` target' , async ( ) => {
148- const span = new SentrySpan ( ) ;
148+ const span = new SentryCore . SentrySpan ( ) ;
149149 span . setAttribute ( 'http.target' , '/users/5' ) ;
150150 mockGetActiveSpan . mockReturnValue ( span ) ;
151151 const mockSpanSetAttribute = vi . spyOn ( span , 'setAttribute' ) ;
0 commit comments