Skip to content

Commit 5614e30

Browse files
committed
modify tests for nuxt-3-min
1 parent b3bbf0c commit 5614e30

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.server.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ test('does not send transactions for build asset folder "_nuxt"', async ({ page
4141

4242
expect(buildAssetFolderOccurred).toBe(false);
4343

44-
expect(transactionEvent.transaction).toBe('GET /test-param/:param()');
44+
// Parametrization does not work in Nuxt 3.7 yet (only in newer versions)
45+
expect(transactionEvent.transaction).toBe('GET /test-param/1234');
4546
});

dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ test.describe('distributed tracing', () => {
2222

2323
const baggageMetaTagContent = await page.locator('meta[name="baggage"]').getAttribute('content');
2424

25-
// URL-encoded for parametrized 'GET /test-param/s0me-param' -> `GET /test-param/:param`
26-
expect(baggageMetaTagContent).toContain(`sentry-transaction=GET%20%2Ftest-param%2F%3Aparam`);
25+
// Parametrization does not work in Nuxt 3.7 yet (only in newer versions)
26+
expect(baggageMetaTagContent).toContain(`sentry-transaction=GET%20%2Ftest-param%2F${PARAM}`); // URL-encoded for 'GET /test-param/s0me-param'
2727
expect(baggageMetaTagContent).toContain(`sentry-trace_id=${serverTxnEvent.contexts?.trace?.trace_id}`);
2828
expect(baggageMetaTagContent).toContain('sentry-sampled=true');
2929
expect(baggageMetaTagContent).toContain('sentry-sample_rate=1');
@@ -48,8 +48,8 @@ test.describe('distributed tracing', () => {
4848
});
4949

5050
expect(serverTxnEvent).toMatchObject({
51-
transaction: `GET /test-param/:param()`, // parametrized
52-
transaction_info: { source: 'route' },
51+
transaction: `GET /test-param/${PARAM}`, // Parametrization does not work in Nuxt 3.7 yet (only in newer versions)
52+
transaction_info: { source: 'url' },
5353
type: 'transaction',
5454
contexts: {
5555
trace: {
@@ -122,8 +122,8 @@ test.describe('distributed tracing', () => {
122122
expect(ssrTxnEvent).toEqual(
123123
expect.objectContaining({
124124
type: 'transaction',
125-
transaction: `GET /test-param/user/:userId()`, // parametrized route
126-
transaction_info: { source: 'route' },
125+
transaction: `GET /test-param/user/${PARAM}`, // Parametrization does not work in Nuxt 3.7 yet (only in newer versions)
126+
transaction_info: { source: 'url' },
127127
contexts: expect.objectContaining({
128128
trace: expect.objectContaining({
129129
op: 'http.server',

0 commit comments

Comments
 (0)