Skip to content

Commit d2894ad

Browse files
committed
canary tests
1 parent 08a9495 commit d2894ad

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

dev-packages/e2e-tests/test-applications/nextjs-16/next.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { withSentryConfig } from '@sentry/nextjs';
22
import type { NextConfig } from 'next';
33

4+
const isCanaryBuild = process.env.CANARY_BUILD === 'true';
5+
46
const nextConfig: NextConfig = {
5-
// experimental: {
6-
// cacheComponents: true,
7-
// },
7+
experimental: {
8+
...(isCanaryBuild ? { cacheComponents: true } : {}),
9+
},
810
};
911

1012
export default withSentryConfig(nextConfig, {

dev-packages/e2e-tests/test-applications/nextjs-16/package.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,30 @@
55
"scripts": {
66
"dev": "next dev",
77
"build": "next build > .tmp_build_stdout 2> .tmp_build_stderr || (cat .tmp_build_stdout && cat .tmp_build_stderr && exit 1)",
8+
"build:canary": "CANARY_BUILD=true next build",
89
"clean": "npx rimraf node_modules pnpm-lock.yaml .tmp_dev_server_logs",
910
"dev:webpack": "next dev --webpack",
1011
"build:webpack": "next build --webpack",
1112
"start": "next start",
1213
"lint": "eslint",
1314
"test:prod": "TEST_ENV=production playwright test",
1415
"test:dev": "TEST_ENV=development playwright test",
16+
"test:prod-canary": "CANARY_BUILD=true TEST_ENV=production playwright test",
17+
"test:dev-canary": "CANARY_BUILD=true playwright test",
1518
"test:build": "pnpm install && pnpm build",
16-
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm build",
17-
"test:assert": "pnpm test:prod && pnpm test:dev"
19+
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm build:canary",
20+
"test:assert": "pnpm test:prod && pnpm test:dev",
21+
"test:assert-canary": "pnpm test:prod-canary && pnpm test:dev-canary"
1822
},
1923
"dependencies": {
2024
"@sentry/nextjs": "latest || *",
21-
"next": "beta",
2225
"ai": "^3.0.0",
26+
"import-in-the-middle": "^1",
27+
"next": "16.0.0-beta.0",
2328
"react": "19.1.0",
2429
"react-dom": "19.1.0",
25-
"zod": "^3.22.4",
26-
"import-in-the-middle": "^1",
27-
"require-in-the-middle": "^7"
30+
"require-in-the-middle": "^7",
31+
"zod": "^3.22.4"
2832
},
2933
"devDependencies": {
3034
"@playwright/test": "~1.53.2",
@@ -38,5 +42,17 @@
3842
},
3943
"volta": {
4044
"extends": "../../package.json"
45+
},
46+
"sentryTest": {
47+
"optionalVariants": [
48+
{
49+
"build-command": "pnpm test:build-canary",
50+
"label": "nextjs-16 (canary)",
51+
"assert-command": "test:assert-canary"
52+
},
53+
{
54+
"//": "todo: add latest variant once next 16 is released"
55+
}
56+
]
4157
}
4258
}

dev-packages/e2e-tests/test-applications/nextjs-16/tests/cached-components-error.test.ts

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

4-
test('should not capture React-internal errors for PPR rendering', async ({ page }) => {
5-
// todo
6-
test.skip(true, 'needs to run on latest canary version');
4+
test('should not capture React-internal errors for cached components', async ({ page }) => {
5+
test.skip(process.env.CANARY_BUILD === 'true', 'needs to run on latest canary version');
6+
77
const pageServerComponentTransactionPromise = waitForTransaction('nextjs-16', async transactionEvent => {
88
return transactionEvent?.transaction === 'GET /ppr-error/[param]';
99
});
1010

1111
let errorEventReceived = false;
1212
waitForError('nextjs-16', async errorEvent => {
13-
return errorEvent?.transaction === 'Page Server Component (/ppr-error/[param])';
13+
return errorEvent?.transaction === 'Page Server Component (/cached-components-error/[param])';
1414
}).then(() => {
1515
errorEventReceived = true;
1616
});
1717

18-
await page.goto(`/ppr-error/foobar?id=1`);
18+
await page.goto(`/cached-components-error/foobar?id=1`);
1919

2020
const pageServerComponentTransaction = await pageServerComponentTransactionPromise;
2121
expect(pageServerComponentTransaction).toBeDefined();

0 commit comments

Comments
 (0)