Skip to content

Commit d05629f

Browse files
committed
test conditions for development-webpack
1 parent a0df026 commit d05629f

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-errors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const packageJson = require('../package.json');
66
test('Sends a client-side exception to Sentry', async ({ page }) => {
77
const nextjsVersion = packageJson.dependencies.next;
88
const nextjsMajor = Number(nextjsVersion.split('.')[0]);
9-
const isDevMode = process.env.TEST_ENV.includes('development');
9+
const isDevMode = !!process.env.TEST_ENV && process.env.TEST_ENV.includes('development');
1010

1111
await page.goto('/');
1212

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { expect, test } from '@playwright/test';
22
import { waitForError } from '@sentry-internal/test-utils';
33

44
test('should have symbolicated dev errors', async ({ page }) => {
5-
test.skip(!process.env.TEST_ENV.includes('development'), 'should be skipped for non-dev mode');
5+
const isDevMode = !!process.env.TEST_ENV && process.env.TEST_ENV.includes('development');
6+
test.skip(!isDevMode, 'should be skipped for non-dev mode');
67

78
await page.goto('/');
89

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const packageJson = require('../package.json');
66
test('Sends a pageload transaction', async ({ page }) => {
77
const nextjsVersion = packageJson.dependencies.next;
88
const nextjsMajor = Number(nextjsVersion.split('.')[0]);
9-
const isDevMode = process.env.TEST_ENV.includes('development');
9+
const isDevMode = !!process.env.TEST_ENV && process.env.TEST_ENV.includes('development');
1010

1111
const pageloadTransactionEventPromise = waitForTransaction('nextjs-app-dir', transactionEvent => {
1212
return transactionEvent?.contexts?.trace?.op === 'pageload' && transactionEvent?.transaction === '/';
@@ -78,8 +78,9 @@ test('Should send a transaction for instrumented server actions', async ({ page
7878
test('Should send a wrapped server action as a child of a nextjs transaction', async ({ page }) => {
7979
const nextjsVersion = packageJson.dependencies.next;
8080
const nextjsMajor = Number(nextjsVersion.split('.')[0]);
81+
const isDevMode = !!process.env.TEST_ENV && process.env.TEST_ENV.includes('development');
8182
test.skip(!isNaN(nextjsMajor) && nextjsMajor < 14, 'only applies to nextjs apps >= version 14');
82-
test.skip(process.env.TEST_ENV.includes('development'), 'this magically only works in production');
83+
test.skip(isDevMode, 'this magically only works in production');
8384

8485
const nextjsPostTransactionPromise = waitForTransaction('nextjs-app-dir', async transactionEvent => {
8586
return (

dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/devErrorSymbolification.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
22
import { waitForError } from '@sentry-internal/test-utils';
33

44
test('should have symbolicated dev errors', async ({ page }) => {
5-
test.skip(process.env.TEST_ENV !== 'development', 'should be skipped for non-dev mode');
5+
test.skip(!process.env.TEST_ENV?.includes('development'), 'should be skipped for non-dev mode');
66

77
await page.goto('/');
88

dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/transactions.test.ts

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

44
const packageJson = require('../package.json');
55

66
test('Sends a pageload transaction', async ({ page }) => {
77
const nextjsVersion = packageJson.dependencies.next;
88
const nextjsMajor = Number(nextjsVersion.split('.')[0]);
9-
const isDevMode = process.env.TEST_ENV === 'development';
9+
const isDevMode = process.env.TEST_ENV?.includes('development');
1010

1111
const pageloadTransactionEventPromise = waitForTransaction('nextjs-pages-dir', transactionEvent => {
1212
return transactionEvent?.contexts?.trace?.op === 'pageload' && transactionEvent?.transaction === '/';

0 commit comments

Comments
 (0)