File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
dev-packages/e2e-tests/test-applications/nextjs-16/tests Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -61,11 +61,24 @@ test('Faulty middlewares', async ({ request }) => {
6161
6262test ( '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+ if ( transactionEvent ?. transaction === 'middleware GET' ) {
70+ allMiddlewareTransactions . push ( transactionEvent as any ) ;
71+ console . log (
72+ 'Found middleware transaction, spans:' ,
73+ transactionEvent . spans ?. map ( s => s . op ) ,
74+ ) ;
75+
76+ const hasHttpClientSpan = ! ! transactionEvent . spans ?. find ( span => span . op === 'http.client' ) ;
77+ if ( hasHttpClientSpan ) {
78+ return true ;
79+ }
80+ }
81+ return false ;
6982 } ) ;
7083
7184 request . get ( '/api/endpoint-behind-middleware' , { headers : { 'x-should-make-request' : '1' } } ) . catch ( ( ) => {
You can’t perform that action at this time.
0 commit comments