Skip to content

Commit

Permalink
ci: Fix nextjs-15 canary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Jul 15, 2024
1 parent 7eb690f commit db666e6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:prod": "TEST_ENV=production __NEXT_EXPERIMENTAL_INSTRUMENTATION=1 playwright test",
"test:dev": "TEST_ENV=development __NEXT_EXPERIMENTAL_INSTRUMENTATION=1 playwright test",
"test:build": "pnpm install && npx playwright install && pnpm build",
"test:build-canary": "pnpm install && pnpm add next@rc && pnpm add react@beta && pnpm add react-dom@beta && npx playwright install && pnpm build",
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm add react@beta && pnpm add react-dom@beta && npx playwright install && pnpm build",
"test:build-latest": "pnpm install && pnpm add next@rc && pnpm add react@beta && pnpm add react-dom@beta && npx playwright install && pnpm build",
"test:assert": "pnpm test:prod && pnpm test:dev"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { expect, test } from '@playwright/test';
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';

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

test('Should capture errors from nested server components when `Sentry.captureRequestError` is added to the `onRequestError` hook', async ({
page,
}) => {
const [, minor, patch, canary] = packageJson.dependencies.next.split('.');

test.skip(
minor === '0' && patch === '0' && patch.includes('canary') && Number(canary) < 63,
'Next.js version does not expose these errors',
);

const errorEventPromise = waitForError('nextjs-15', errorEvent => {
return !!errorEvent?.exception?.values?.some(value => value.value === 'I am technically uncatchable');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { expect, test } from '@playwright/test';
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';

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

test('Should capture errors for crashing streaming promises in server components when `Sentry.captureRequestError` is added to the `onRequestError` hook', async ({
page,
}) => {
const [, minor, patch, canary] = packageJson.dependencies.next.split('.');

test.skip(
minor === '0' && patch === '0' && patch.includes('canary') && Number(canary) < 63,
'Next.js version does not expose these errors',
);

const errorEventPromise = waitForError('nextjs-15', errorEvent => {
return !!errorEvent?.exception?.values?.some(value => value.value === 'I am a data streaming error');
});
Expand Down

0 comments on commit db666e6

Please sign in to comment.