Skip to content

Commit 305aa01

Browse files
committed
test(nuxt, nitro): Use the conventions constants in the tunnel tests
1 parent 8730aeb commit 305aa01

6 files changed

Lines changed: 15 additions & 8 deletions

File tree

‎dev-packages/e2e-tests/test-applications/nitro-3/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"devDependencies": {
2121
"@playwright/test": "~1.63.0",
22+
"@sentry/conventions": "0.27.0",
2223
"@sentry-internal/test-utils": "link:../../../test-utils",
2324
"@sentry/core": "latest || *",
2425
"nitro": "^3.0.260522-beta",

‎dev-packages/e2e-tests/test-applications/nitro-3/tests/tunnel.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { URL_PATH } from '@sentry/conventions/attributes';
2+
import { HTTP_SERVER } from '@sentry/conventions/op';
13
import { expect, test } from '@playwright/test';
24
import { getSpanOp, waitForStreamedSpan } from '@sentry-internal/test-utils';
35

@@ -11,7 +13,7 @@ test('answers the managed tunnel before the app auth middleware', async ({ page
1113

1214
const tunnelServerSpanPromise = waitForStreamedSpan(
1315
'nitro-3',
14-
span => getSpanOp(span) === 'http.server' && TUNNEL_PATH.test(String(span.attributes['url.path']?.value ?? '')),
16+
span => getSpanOp(span) === HTTP_SERVER && TUNNEL_PATH.test(String(span.attributes[URL_PATH]?.value ?? '')),
1517
);
1618
const tunnelResponsePromise = page.waitForResponse(
1719
response => response.request().method() === 'POST' && TUNNEL_PATH.test(new URL(response.url()).pathname),
@@ -28,7 +30,7 @@ test('answers the managed tunnel before the app auth middleware', async ({ page
2830
const anchorSpanPromise = waitForStreamedSpan(
2931
'nitro-3',
3032
span =>
31-
getSpanOp(span) === 'http.server' && String(span.attributes['url.path']?.value ?? '') === '/api/test-transaction',
33+
getSpanOp(span) === HTTP_SERVER && String(span.attributes[URL_PATH]?.value ?? '') === '/api/test-transaction',
3234
);
3335
await page.request.get('/api/test-transaction');
3436

‎dev-packages/e2e-tests/test-applications/nuxt-4/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@playwright/test": "~1.63.0",
34+
"@sentry/conventions": "0.27.0",
3435
"@sentry-internal/test-utils": "link:../../../test-utils"
3536
},
3637
"volta": {

‎dev-packages/e2e-tests/test-applications/nuxt-4/tests/tunnel.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { URL_PATH } from '@sentry/conventions/attributes';
2+
import { HTTP_SERVER } from '@sentry/conventions/op';
13
import { expect, test } from '@playwright/test';
24
import { getSpanOp, waitForStreamedSpan } from '@sentry-internal/test-utils';
35

@@ -11,7 +13,7 @@ test('answers the managed tunnel before the app auth middleware', async ({ page
1113

1214
const tunnelServerSpanPromise = waitForStreamedSpan(
1315
'nuxt-4',
14-
span => getSpanOp(span) === 'http.server' && TUNNEL_PATH.test(String(span.attributes['url.path']?.value ?? '')),
16+
span => getSpanOp(span) === HTTP_SERVER && TUNNEL_PATH.test(String(span.attributes[URL_PATH]?.value ?? '')),
1517
);
1618
const tunnelResponsePromise = page.waitForResponse(
1719
response => response.request().method() === 'POST' && TUNNEL_PATH.test(new URL(response.url()).pathname),
@@ -27,8 +29,7 @@ test('answers the managed tunnel before the app auth middleware', async ({ page
2729
// would arrive first.
2830
const anchorSpanPromise = waitForStreamedSpan(
2931
'nuxt-4',
30-
span =>
31-
getSpanOp(span) === 'http.server' && String(span.attributes['url.path']?.value ?? '') === '/api/test-param/123',
32+
span => getSpanOp(span) === HTTP_SERVER && String(span.attributes[URL_PATH]?.value ?? '') === '/api/test-param/123',
3233
);
3334
await page.request.get('/api/test-param/123');
3435

‎dev-packages/e2e-tests/test-applications/nuxt-5/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"devDependencies": {
3939
"@playwright/test": "~1.63.0",
40+
"@sentry/conventions": "0.27.0",
4041
"@sentry-internal/test-utils": "link:../../../test-utils"
4142
},
4243
"sentryTest": {

‎dev-packages/e2e-tests/test-applications/nuxt-5/tests/tunnel.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { URL_PATH } from '@sentry/conventions/attributes';
2+
import { HTTP_SERVER } from '@sentry/conventions/op';
13
import { expect, test } from '@playwright/test';
24
import { getSpanOp, waitForStreamedSpan } from '@sentry-internal/test-utils';
35

@@ -11,7 +13,7 @@ test('answers the managed tunnel before the app auth middleware', async ({ page
1113

1214
const tunnelServerSpanPromise = waitForStreamedSpan(
1315
'nuxt-5',
14-
span => getSpanOp(span) === 'http.server' && TUNNEL_PATH.test(String(span.attributes['url.path']?.value ?? '')),
16+
span => getSpanOp(span) === HTTP_SERVER && TUNNEL_PATH.test(String(span.attributes[URL_PATH]?.value ?? '')),
1517
);
1618
const tunnelResponsePromise = page.waitForResponse(
1719
response => response.request().method() === 'POST' && TUNNEL_PATH.test(new URL(response.url()).pathname),
@@ -27,8 +29,7 @@ test('answers the managed tunnel before the app auth middleware', async ({ page
2729
// would arrive first.
2830
const anchorSpanPromise = waitForStreamedSpan(
2931
'nuxt-5',
30-
span =>
31-
getSpanOp(span) === 'http.server' && String(span.attributes['url.path']?.value ?? '') === '/api/test-param/123',
32+
span => getSpanOp(span) === HTTP_SERVER && String(span.attributes[URL_PATH]?.value ?? '') === '/api/test-param/123',
3233
);
3334
await page.request.get('/api/test-param/123');
3435

0 commit comments

Comments
 (0)