Skip to content

Commit 47af194

Browse files
committed
update tests for v13
1 parent 362561a commit 47af194

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

dev-packages/e2e-tests/test-applications/nextjs-13/instrumentation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function register() {
1212
// We are doing a lot of events at once in this test app
1313
bufferSize: 1000,
1414
},
15+
debug: true,
1516
});
1617
}
1718
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@types/node": "18.11.17",
1818
"@types/react": "18.0.26",
1919
"@types/react-dom": "18.0.9",
20-
"next": "13.2.0",
20+
"next": "13.5.7",
2121
"react": "18.2.0",
2222
"react-dom": "18.2.0",
2323
"typescript": "4.9.5"

dev-packages/e2e-tests/test-applications/nextjs-13/tests/isomorphic/getInitialProps.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('should propagate serverside `getInitialProps` trace to client', async ({ p
1111

1212
const serverTransactionPromise = waitForTransaction('nextjs-13', async transactionEvent => {
1313
return (
14-
transactionEvent.transaction === '/[param]/withInitialProps' &&
14+
transactionEvent.transaction === 'GET /[param]/withInitialProps' &&
1515
transactionEvent.contexts?.trace?.op === 'http.server'
1616
);
1717
});
@@ -47,7 +47,7 @@ test('should propagate serverside `getInitialProps` trace to client', async ({ p
4747
status: 'ok',
4848
},
4949
},
50-
transaction: '/[param]/withInitialProps',
50+
transaction: 'GET /[param]/withInitialProps',
5151
transaction_info: {
5252
source: 'route',
5353
},

dev-packages/e2e-tests/test-applications/nextjs-13/tests/isomorphic/getServerSideProps.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('Should record performance for getServerSideProps', async ({ page }) => {
1111

1212
const serverTransactionPromise = waitForTransaction('nextjs-13', async transactionEvent => {
1313
return (
14-
transactionEvent.transaction === '/[param]/withServerSideProps' &&
14+
transactionEvent.transaction === 'GET /[param]/withServerSideProps' &&
1515
transactionEvent.contexts?.trace?.op === 'http.server'
1616
);
1717
});
@@ -47,7 +47,7 @@ test('Should record performance for getServerSideProps', async ({ page }) => {
4747
status: 'ok',
4848
},
4949
},
50-
transaction: '/[param]/withServerSideProps',
50+
transaction: 'GET /[param]/withServerSideProps',
5151
transaction_info: {
5252
source: 'route',
5353
},

dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/getServerSideProps.test.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('Should report an error event for errors thrown in getServerSideProps', asy
88

99
const transactionEventPromise = waitForTransaction('nextjs-13', transactionEvent => {
1010
return (
11-
transactionEvent.transaction === '/error-getServerSideProps' &&
11+
transactionEvent.transaction === 'GET /error-getServerSideProps' &&
1212
transactionEvent.contexts?.trace?.op === 'http.server'
1313
);
1414
});
@@ -60,11 +60,11 @@ test('Should report an error event for errors thrown in getServerSideProps', asy
6060
data: {
6161
'http.response.status_code': 500,
6262
'sentry.op': 'http.server',
63-
'sentry.origin': 'auto.function.nextjs',
63+
'sentry.origin': 'auto',
6464
'sentry.source': 'route',
6565
},
6666
op: 'http.server',
67-
origin: 'auto.function.nextjs',
67+
origin: 'auto',
6868
span_id: expect.any(String),
6969
status: 'internal_error',
7070
trace_id: expect.any(String),
@@ -80,13 +80,13 @@ test('Should report an error event for errors thrown in getServerSideProps', asy
8080
},
8181
start_timestamp: expect.any(Number),
8282
timestamp: expect.any(Number),
83-
transaction: '/error-getServerSideProps',
84-
transaction_info: { source: 'route' },
83+
transaction: 'GET /error-getServerSideProps',
84+
transaction_info: { source: 'custom' },
8585
type: 'transaction',
8686
});
8787
});
8888

89-
test('Should report an error event for errors thrown in getServerSideProps in pages with custom page extensions', async ({
89+
test.only('Should report an error event for errors thrown in getServerSideProps in pages with custom page extensions', async ({
9090
page,
9191
}) => {
9292
const errorEventPromise = waitForError('nextjs-13', errorEvent => {
@@ -95,7 +95,8 @@ test('Should report an error event for errors thrown in getServerSideProps in pa
9595

9696
const transactionEventPromise = waitForTransaction('nextjs-13', transactionEvent => {
9797
return (
98-
transactionEvent.transaction === '/customPageExtension' && transactionEvent.contexts?.trace?.op === 'http.server'
98+
transactionEvent.transaction === 'GET /customPageExtension' &&
99+
transactionEvent.contexts?.trace?.op === 'http.server'
99100
);
100101
});
101102

@@ -146,11 +147,11 @@ test('Should report an error event for errors thrown in getServerSideProps in pa
146147
data: {
147148
'http.response.status_code': 500,
148149
'sentry.op': 'http.server',
149-
'sentry.origin': 'auto.function.nextjs',
150+
'sentry.origin': 'auto',
150151
'sentry.source': 'route',
151152
},
152153
op: 'http.server',
153-
origin: 'auto.function.nextjs',
154+
origin: 'auto',
154155
span_id: expect.any(String),
155156
status: 'internal_error',
156157
trace_id: expect.any(String),
@@ -166,8 +167,8 @@ test('Should report an error event for errors thrown in getServerSideProps in pa
166167
},
167168
start_timestamp: expect.any(Number),
168169
timestamp: expect.any(Number),
169-
transaction: '/customPageExtension',
170-
transaction_info: { source: 'route' },
170+
transaction: 'GET /customPageExtension',
171+
transaction_info: { source: 'custom' },
171172
type: 'transaction',
172173
});
173174
});

0 commit comments

Comments
 (0)