Skip to content

Commit 2840a77

Browse files
committed
Mock fetch test API to avoid flakiness due to speed.
1 parent e3f5201 commit 2840a77

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/nextjs/test/integration/test/client/tracingFetch.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import { test, expect } from '@playwright/test';
33
import { Transaction } from '@sentry/types';
44

55
test('should correctly instrument `fetch` for performance tracing', async ({ page }) => {
6+
await page.route('http://example.com/**/*', route => {
7+
return route.fulfill({
8+
status: 200,
9+
body: JSON.stringify({
10+
foo: 'bar',
11+
}),
12+
});
13+
});
14+
615
const transaction = await getMultipleSentryEnvelopeRequests<Transaction>(page, 1, {
716
url: '/fetch',
817
envelopeType: 'transaction',

0 commit comments

Comments
 (0)