Skip to content

Commit 6490162

Browse files
committed
fix: added logs for ci
1 parent ea20d8d commit 6490162

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,25 @@ test('Faulty middlewares', async ({ request }) => {
6161

6262
test('Should trace outgoing fetch requests inside middleware and create breadcrumbs for it', async ({ request }) => {
6363
test.skip(isDevMode, 'The fetch requests ends up in a separate tx in dev atm');
64+
65+
// First, let's see what middleware transactions we get
66+
// FIXME: Remove this once we know what's going on
67+
const allMiddlewareTransactions: Event[] = [];
6468
const middlewareTransactionPromise = waitForTransaction('nextjs-16', async transactionEvent => {
65-
return (
66-
transactionEvent?.transaction === 'middleware GET' &&
67-
!!transactionEvent.spans?.find(span => span.op === 'http.client')
68-
);
69+
console.log('Transaction event:', transactionEvent?.transaction);
70+
if (transactionEvent?.transaction === 'middleware GET') {
71+
allMiddlewareTransactions.push(transactionEvent as any);
72+
console.log(
73+
'Found middleware transaction, spans:',
74+
transactionEvent.spans?.map(s => s.op),
75+
);
76+
77+
const hasHttpClientSpan = !!transactionEvent.spans?.find(span => span.op === 'http.client');
78+
if (hasHttpClientSpan) {
79+
return true;
80+
}
81+
}
82+
return false;
6983
});
7084

7185
request.get('/api/endpoint-behind-middleware', { headers: { 'x-should-make-request': '1' } }).catch(() => {

0 commit comments

Comments
 (0)