Skip to content

Commit 1e5ff11

Browse files
committed
cleanup...
1 parent 90c88b3 commit 1e5ff11

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('Creates a pageload transaction for app router routes', async ({ page }) =>
66

77
const clientPageloadTransactionPromise = waitForTransaction('nextjs-13-app-dir', transactionEvent => {
88
return (
9-
transactionEvent?.transaction === `/server-component/parameter/${randomRoute}` &&
9+
transactionEvent.transaction === `/server-component/parameter/${randomRoute}` &&
1010
transactionEvent.contexts?.trace?.op === 'pageload'
1111
);
1212
});
@@ -26,7 +26,7 @@ test('Creates a navigation transaction for app router routes', async ({ page })
2626
JSON.stringify(transactionEvent.contexts?.trace, null, 2),
2727
);
2828
return (
29-
transactionEvent?.transaction === `/server-component/parameter/${randomRoute}` &&
29+
transactionEvent.transaction === `/server-component/parameter/${randomRoute}` &&
3030
transactionEvent.contexts?.trace?.op === 'pageload'
3131
);
3232
});
@@ -42,7 +42,7 @@ test('Creates a navigation transaction for app router routes', async ({ page })
4242
JSON.stringify(transactionEvent.contexts?.trace, null, 2),
4343
);
4444
return (
45-
transactionEvent?.transaction === '/server-component/parameter/foo/bar/baz' &&
45+
transactionEvent.transaction === '/server-component/parameter/foo/bar/baz' &&
4646
transactionEvent.contexts?.trace?.op === 'navigation'
4747
);
4848
});
@@ -54,7 +54,7 @@ test('Creates a navigation transaction for app router routes', async ({ page })
5454
JSON.stringify(transactionEvent.contexts?.trace, null, 2),
5555
);
5656
return (
57-
transactionEvent?.transaction === 'Page Server Component (/server-component/parameter/[...parameters])' &&
57+
transactionEvent.transaction === 'Page Server Component (/server-component/parameter/[...parameters])' &&
5858
(await clientNavigationTransactionPromise).contexts?.trace?.trace_id ===
5959
transactionEvent.contexts?.trace?.trace_id
6060
);

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { waitForError, waitForTransaction } from '@sentry-internal/event-proxy-s
33

44
test('Should create a transaction for route handlers', async ({ request }) => {
55
const routehandlerTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => {
6-
console.log('should be GET /route-handlers/[param]', transactionEvent?.transaction);
6+
console.log('should be GET /route-handlers/[param]', transactionEvent.transaction);
77
// Sometimes, next.js adds /route there, we accept both variants
88
return (
9-
transactionEvent?.transaction === 'GET /route-handlers/[param]' ||
10-
transactionEvent?.transaction === 'GET /route-handlers/[param]/route'
9+
transactionEvent.transaction === 'GET /route-handlers/[param]' ||
10+
transactionEvent.transaction === 'GET /route-handlers/[param]/route'
1111
);
1212
});
1313

@@ -25,11 +25,11 @@ test('Should create a transaction for route handlers and correctly set span stat
2525
request,
2626
}) => {
2727
const routehandlerTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => {
28-
console.log('should be POST /route-handlers/[param]', transactionEvent?.transaction);
28+
console.log('should be POST /route-handlers/[param]', transactionEvent.transaction);
2929
// Sometimes, next.js adds /route there, we accept both variants
3030
return (
31-
transactionEvent?.transaction === 'POST /route-handlers/[param]' ||
32-
transactionEvent?.transaction === 'POST /route-handlers/[param]/route'
31+
transactionEvent.transaction === 'POST /route-handlers/[param]' ||
32+
transactionEvent.transaction === 'POST /route-handlers/[param]/route'
3333
);
3434
});
3535

@@ -49,11 +49,11 @@ test('Should record exceptions and transactions for faulty route handlers', asyn
4949

5050
const routehandlerTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => {
5151
console.log('transactionEvent3', JSON.stringify(transactionEvent, null, 2));
52-
console.log('should be PUT /route-handlers/[param]', transactionEvent?.transaction);
52+
console.log('should be PUT /route-handlers/[param]', transactionEvent.transaction);
5353
// Sometimes, next.js adds /route there, we accept both variants
5454
return (
55-
transactionEvent?.transaction === 'PUT /route-handlers/[param]' ||
56-
transactionEvent?.transaction === 'PUT /route-handlers/[param]/route'
55+
transactionEvent.transaction === 'PUT /route-handlers/[param]' ||
56+
transactionEvent.transaction === 'PUT /route-handlers/[param]/route'
5757
);
5858
});
5959

@@ -82,7 +82,7 @@ test('Should record exceptions and transactions for faulty route handlers', asyn
8282
test.describe('Edge runtime', () => {
8383
test('should create a transaction for route handlers', async ({ request }) => {
8484
const routehandlerTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => {
85-
return transactionEvent?.transaction === 'PATCH /route-handlers/[param]/edge';
85+
return transactionEvent.transaction === 'PATCH /route-handlers/[param]/edge';
8686
});
8787

8888
const response = await request.patch('/route-handlers/bar/edge');
@@ -100,7 +100,7 @@ test.describe('Edge runtime', () => {
100100
});
101101

102102
const routehandlerTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => {
103-
return transactionEvent?.transaction === 'DELETE /route-handlers/[param]/edge';
103+
return transactionEvent.transaction === 'DELETE /route-handlers/[param]/edge';
104104
});
105105

106106
await request.delete('/route-handlers/baz/edge').catch(() => {

0 commit comments

Comments
 (0)