Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ test.describe('SDK-internal behavior', () => {
test('Injects fetch proxy script for SvelteKit<2.16.0', async ({ page }) => {
await page.goto('/');

const sentryCarrier = await page.evaluate('typeof window.__SENTRY__');
// @ts-expect-error this is defined
await page.waitForFunction(() => typeof window.__SENTRY__ === 'object');
const proxyHandle = await page.evaluate('typeof window._sentryFetchProxy');

// sanity check
expect(sentryCarrier).toBe('object');

// fetch proxy script ran
expect(proxyHandle).toBe('function');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { waitForInitialPageload } from './utils';
test.describe('SDK-internal behavior', () => {
test("Doesn't inject fetch proxy script for SvelteKit>=2.16.0", async ({ page }) => {
await waitForInitialPageload(page, { route: '/' });
const sentryCarrier = await page.evaluate('typeof window.__SENTRY__');
const proxyHandle = await page.evaluate('typeof window._sentryFetchProxy');

// sanity check
expect(sentryCarrier).toBe('object');
// @ts-expect-error this is defined
await page.waitForFunction(() => typeof window.__SENTRY__ === 'object');

const proxyHandle = await page.evaluate('typeof window._sentryFetchProxy');

// fetch proxy script didn't run
expect(proxyHandle).toBe('undefined');
Expand Down
Loading