Skip to content

Commit 036c380

Browse files
committed
fix tests solidstart
1 parent ed97658 commit 036c380

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/solidstart/test/server/withServerActionInstrumentation.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SentrySpan } from '@sentry/core';
1+
import * as SentryCore from '@sentry/core';
22
import * as SentryNode from '@sentry/node';
33
import {
44
createTransport,
@@ -16,7 +16,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
1616
import { withServerActionInstrumentation } from '../../src/server';
1717

1818
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 () => {});
2020
const mockGetActiveSpan = vi.spyOn(SentryNode, 'getActiveSpan');
2121

2222
const 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

Comments
 (0)