We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fadd2eb commit c530a44Copy full SHA for c530a44
packages/cloudflare/test/request.test.ts
@@ -90,10 +90,15 @@ describe('withSentry', () => {
90
});
91
92
test('flush must be called when all waitUntil are done', async () => {
93
- const flushSpy = vi.spyOn(SentryCore.Client.prototype, 'flush');
+ // 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);
98
vi.useFakeTimers();
99
onTestFinished(() => {
100
vi.useRealTimers();
101
+ flushSpy.mockRestore();
102
103
const waits: Promise<unknown>[] = [];
104
const waitUntil = vi.fn(promise => waits.push(promise));
0 commit comments