From 95716edfe375802e5b70412018f056db10aac25f Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Wed, 3 Dec 2025 17:20:18 +0100 Subject: [PATCH 1/2] test(nuxt): relax captured error assertion --- .../test-applications/nuxt-3/tests/middleware.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts index e9debf8496c2..7f208c2c1eca 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts @@ -121,7 +121,11 @@ test.describe('Server Middleware Instrumentation', () => { type: 'Error', mechanism: expect.objectContaining({ handled: false, - type: 'auto.middleware.nuxt', + // Type changes depending on whether it is being wrapped by Nitro or not + // This is a timing problem, sometimes Nitro can capture the error first, and sometimes it can't + // If nitro captures the error first, the type will be 'chained' + // If Sentry captures the error first, the type will be 'auto.middleware.nuxt' + // type: 'auto.middleware.nuxt', }), }), ); From e27cb507e81ceb725275441f1d9b3c0b9d3c27ed Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Wed, 3 Dec 2025 17:58:49 +0100 Subject: [PATCH 2/2] ref: don't relax it too much --- .../e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts index 7f208c2c1eca..7cb3c84e9050 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/middleware.test.ts @@ -125,7 +125,7 @@ test.describe('Server Middleware Instrumentation', () => { // This is a timing problem, sometimes Nitro can capture the error first, and sometimes it can't // If nitro captures the error first, the type will be 'chained' // If Sentry captures the error first, the type will be 'auto.middleware.nuxt' - // type: 'auto.middleware.nuxt', + type: expect.stringMatching(/^(auto\.middleware\.nuxt|chained)$/), }), }), );