Skip to content

Commit ac81016

Browse files
authored
test: Fix test for release branch (#11612)
Sadly, our release failed. The reason is that the lazy load integration test loads the CDN bundle with the current version, which obv. does not exist yet 😬 so we now properly mock this so this always passes.
1 parent 976afe2 commit ac81016

File tree

1 file changed

+9
-0
lines changed
  • dev-packages/browser-integration-tests/suites/integrations/lazyLoad/validIntegration

1 file changed

+9
-0
lines changed

dev-packages/browser-integration-tests/suites/integrations/lazyLoad/validIntegration/test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
import { expect } from '@playwright/test';
2+
import { SDK_VERSION } from '@sentry/browser';
23

34
import { sentryTest } from '../../../../utils/fixtures';
45

56
sentryTest('it allows to lazy load an integration', async ({ getLocalTestUrl, page }) => {
67
const url = await getLocalTestUrl({ testDir: __dirname });
78

9+
await page.route(`https://browser.sentry-cdn.com/${SDK_VERSION}/httpclient.min.js`, route => {
10+
return route.fulfill({
11+
status: 200,
12+
contentType: 'application/javascript;',
13+
body: "window.Sentry.httpClientIntegration = () => ({ name: 'HttpClient' })",
14+
});
15+
});
16+
817
await page.goto(url);
918

1019
const hasIntegration = await page.evaluate('!!window.Sentry.getClient()?.getIntegrationByName("HttpClient")');

0 commit comments

Comments
 (0)