Skip to content

Commit 1e1d734

Browse files
committed
update tests to use shouldSkipFeatureFlagsTest and getLocalTestUrl
1 parent 3dcf07e commit 1e1d734

File tree

3 files changed

+8
-20
lines changed
  • dev-packages/browser-integration-tests

3 files changed

+8
-20
lines changed

dev-packages/browser-integration-tests/suites/integrations/featureFlags/openfeature/basic/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../../utils/fixtures';
44

5-
import { envelopeRequestParser, shouldSkipOpenFeatureTest, waitForErrorRequest } from '../../../../../utils/helpers';
5+
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
66

77
const FLAG_BUFFER_SIZE = 100; // Corresponds to constant in featureFlags.ts, in browser utils.
88

9-
sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestPath, page }) => {
10-
if (shouldSkipOpenFeatureTest()) {
9+
sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
10+
if (shouldSkipFeatureFlagsTest()) {
1111
sentryTest.skip();
1212
}
1313

@@ -19,7 +19,7 @@ sentryTest('Basic test with eviction, update, and no async tasks', async ({ getL
1919
});
2020
});
2121

22-
const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true });
22+
const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });
2323
await page.goto(url);
2424

2525
await page.waitForFunction(bufferSize => {

dev-packages/browser-integration-tests/suites/integrations/featureFlags/openfeature/withScope/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../../utils/fixtures';
44

5-
import { envelopeRequestParser, shouldSkipOpenFeatureTest, waitForErrorRequest } from '../../../../../utils/helpers';
5+
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
66

77
import type { Scope } from '@sentry/browser';
88

9-
sentryTest('Flag evaluations in forked scopes are stored separately.', async ({ getLocalTestPath, page }) => {
10-
if (shouldSkipOpenFeatureTest()) {
9+
sentryTest('Flag evaluations in forked scopes are stored separately.', async ({ getLocalTestUrl, page }) => {
10+
if (shouldSkipFeatureFlagsTest()) {
1111
sentryTest.skip();
1212
}
1313

@@ -19,7 +19,7 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
1919
});
2020
});
2121

22-
const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true });
22+
const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });
2323
await page.goto(url);
2424

2525
const forkedReqPromise = waitForErrorRequest(page, event => !!event.tags && event.tags.isForked === true);

dev-packages/browser-integration-tests/utils/helpers.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,18 +285,6 @@ export function shouldSkipFeatureFlagsTest(): boolean {
285285
return bundle != null && !bundle.includes('esm') && !bundle.includes('cjs');
286286
}
287287

288-
/**
289-
* We can only test the openFeature browser integration in certain bundles/packages:
290-
* - NPM (ESM, CJS)
291-
* - Not CDNs.
292-
*
293-
* @returns `true` if we should skip the openFeature test
294-
*/
295-
export function shouldSkipOpenFeatureTest(): boolean {
296-
const bundle = process.env.PW_BUNDLE as string | undefined;
297-
return bundle != null && !bundle.includes('esm') && !bundle.includes('cjs');
298-
}
299-
300288
/**
301289
* Waits until a number of requests matching urlRgx at the given URL arrive.
302290
* If the timeout option is configured, this function will abort waiting, even if it hasn't received the configured

0 commit comments

Comments
 (0)