Skip to content

Commit c530a44

Browse files
committed
update test
1 parent fadd2eb commit c530a44

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/cloudflare/test/request.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,15 @@ describe('withSentry', () => {
9090
});
9191

9292
test('flush must be called when all waitUntil are done', async () => {
93-
const flushSpy = vi.spyOn(SentryCore.Client.prototype, 'flush');
93+
// Reset all mocks to ensure clean state
94+
vi.clearAllMocks();
95+
vi.restoreAllMocks();
96+
97+
const flushSpy = vi.spyOn(SentryCore.Client.prototype, 'flush').mockResolvedValue(true);
9498
vi.useFakeTimers();
9599
onTestFinished(() => {
96100
vi.useRealTimers();
101+
flushSpy.mockRestore();
97102
});
98103
const waits: Promise<unknown>[] = [];
99104
const waitUntil = vi.fn(promise => waits.push(promise));

0 commit comments

Comments
 (0)