Skip to content

Commit dbf2a28

Browse files
committed
clean up dev tests
1 parent 069b4b1 commit dbf2a28

File tree

5 files changed

+5
-30
lines changed

5 files changed

+5
-30
lines changed

dev-packages/e2e-tests/test-applications/nextjs-16/tests/async-params.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { expect, test } from '@playwright/test';
22
import fs from 'fs';
3+
import { isDevMode } from './isDevMode';
34

45
test('should not print warning for async params', async ({ page }) => {
5-
test.skip(
6-
process.env.TEST_ENV !== 'development' && process.env.TEST_ENV !== 'dev-turbopack',
7-
'should be skipped for non-dev mode',
8-
);
6+
test.skip(!isDevMode, 'should be skipped for non-dev mode');
97
await page.goto('/');
108

119
// If the server exits with code 1, the test will fail (see instrumentation.ts)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const isDevMode = !!process.env.TEST_ENV && process.env.TEST_ENV.includes('development');

dev-packages/e2e-tests/test-applications/nextjs-16/tests/nested-rsc-error.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
import { expect, test } from '@playwright/test';
22
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';
33

4-
const packageJson = require('../package.json');
5-
64
test('Should capture errors from nested server components when `Sentry.captureRequestError` is added to the `onRequestError` hook', async ({
75
page,
86
}) => {
9-
const [, minor, patch, canary] = packageJson.dependencies.next.split('.');
10-
11-
test.skip(
12-
minor === '0' &&
13-
patch.startsWith('0-') &&
14-
((patch.includes('canary') && Number(canary) < 63) || patch.includes('rc')),
15-
'Next.js version does not expose these errors',
16-
);
17-
187
const errorEventPromise = waitForError('nextjs-16', errorEvent => {
198
return !!errorEvent?.exception?.values?.some(value => value.value === 'I am technically uncatchable');
209
});

dev-packages/e2e-tests/test-applications/nextjs-16/tests/prefetch-spans.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { expect, test } from '@playwright/test';
22
import { waitForTransaction } from '@sentry-internal/test-utils';
3+
import { isDevMode } from './isDevMode';
34

45
test('Prefetch client spans should have a http.request.prefetch attribute', async ({ page }) => {
5-
test.skip(
6-
process.env.TEST_ENV === 'development' || process.env.TEST_ENV === 'dev-turbopack',
7-
"Prefetch requests don't have the prefetch header in dev mode",
8-
);
6+
test.skip(isDevMode, "Prefetch requests don't have the prefetch header in dev mode");
97

108
const pageloadTransactionPromise = waitForTransaction('nextjs-16', async transactionEvent => {
119
return transactionEvent?.transaction === '/prefetching';

dev-packages/e2e-tests/test-applications/nextjs-16/tests/streaming-rsc-error.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
import { expect, test } from '@playwright/test';
22
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';
33

4-
const packageJson = require('../package.json');
5-
64
test('Should capture errors for crashing streaming promises in server components when `Sentry.captureRequestError` is added to the `onRequestError` hook', async ({
75
page,
86
}) => {
9-
const [, minor, patch, canary] = packageJson.dependencies.next.split('.');
10-
11-
test.skip(
12-
minor === '0' &&
13-
patch.startsWith('0-') &&
14-
((patch.includes('canary') && Number(canary) < 63) || patch.includes('rc')),
15-
'Next.js version does not expose these errors',
16-
);
17-
187
const errorEventPromise = waitForError('nextjs-16', errorEvent => {
198
return !!errorEvent?.exception?.values?.some(value => value.value === 'I am a data streaming error');
209
});

0 commit comments

Comments
 (0)