1
- import { SentrySpan } from '@sentry/core' ;
1
+ import * as SentryCore from '@sentry/core' ;
2
2
import * as SentryNode from '@sentry/node' ;
3
3
import {
4
4
createTransport ,
@@ -16,7 +16,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
16
16
import { withServerActionInstrumentation } from '../../src/server' ;
17
17
18
18
const 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 ( ) => { } ) ;
20
20
const mockGetActiveSpan = vi . spyOn ( SentryNode , 'getActiveSpan' ) ;
21
21
22
22
const mockGetRequestEvent = vi . fn ( ) ;
@@ -126,7 +126,7 @@ describe('withServerActionInstrumentation', () => {
126
126
} ) ;
127
127
128
128
it ( 'sets a server action name on the active span' , async ( ) => {
129
- const span = new SentrySpan ( ) ;
129
+ const span = new SentryCore . SentrySpan ( ) ;
130
130
span . setAttribute ( 'http.target' , '/_server' ) ;
131
131
mockGetActiveSpan . mockReturnValue ( span ) ;
132
132
const mockSpanSetAttribute = vi . spyOn ( span , 'setAttribute' ) ;
@@ -145,7 +145,7 @@ describe('withServerActionInstrumentation', () => {
145
145
} ) ;
146
146
147
147
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 ( ) ;
149
149
span . setAttribute ( 'http.target' , '/users/5' ) ;
150
150
mockGetActiveSpan . mockReturnValue ( span ) ;
151
151
const mockSpanSetAttribute = vi . spyOn ( span , 'setAttribute' ) ;
0 commit comments