Skip to content

Commit fc5684d

Browse files
chargomes1gr1d
authored andcommitted
update nest-11 tests
1 parent 29af416 commit fc5684d

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

dev-packages/e2e-tests/test-applications/nestjs-11/tests/cron-decorator.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { expect, test } from '@playwright/test';
22
import { waitForEnvelopeItem, waitForError } from '@sentry-internal/test-utils';
33

44
test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => {
5-
const inProgressEnvelopePromise = waitForEnvelopeItem('nestjs-basic', envelope => {
5+
const inProgressEnvelopePromise = waitForEnvelopeItem('nestjs-11', envelope => {
66
return (
77
envelope[0].type === 'check_in' &&
88
envelope[1]['monitor_slug'] === 'test-cron-slug' &&
99
envelope[1]['status'] === 'in_progress'
1010
);
1111
});
1212

13-
const okEnvelopePromise = waitForEnvelopeItem('nestjs-basic', envelope => {
13+
const okEnvelopePromise = waitForEnvelopeItem('nestjs-11', envelope => {
1414
return (
1515
envelope[0].type === 'check_in' &&
1616
envelope[1]['monitor_slug'] === 'test-cron-slug' &&
@@ -63,7 +63,7 @@ test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => {
6363
});
6464

6565
test('Sends exceptions to Sentry on error in cron job', async ({ baseURL }) => {
66-
const errorEventPromise = waitForError('nestjs-basic', event => {
66+
const errorEventPromise = waitForError('nestjs-11', event => {
6767
return !event.type && event.exception?.values?.[0]?.value === 'Test error from cron job';
6868
});
6969

dev-packages/e2e-tests/test-applications/nestjs-11/tests/errors.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { expect, test } from '@playwright/test';
22
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';
33

4-
test('Sends exception to Sentry', async ({ baseURL }) => {
5-
const errorEventPromise = waitForError('nestjs-basic', event => {
4+
test.only('Sends exception to Sentry', async ({ baseURL }) => {
5+
const errorEventPromise = waitForError('nestjs-11', event => {
66
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
77
});
88

@@ -33,27 +33,27 @@ test('Sends exception to Sentry', async ({ baseURL }) => {
3333
test('Does not send HttpExceptions to Sentry', async ({ baseURL }) => {
3434
let errorEventOccurred = false;
3535

36-
waitForError('nestjs-basic', event => {
36+
waitForError('nestjs-11', event => {
3737
if (!event.type && event.exception?.values?.[0]?.value === 'This is an expected 400 exception with id 123') {
3838
errorEventOccurred = true;
3939
}
4040

4141
return event?.transaction === 'GET /test-expected-400-exception/:id';
4242
});
4343

44-
waitForError('nestjs-basic', event => {
44+
waitForError('nestjs-11', event => {
4545
if (!event.type && event.exception?.values?.[0]?.value === 'This is an expected 500 exception with id 123') {
4646
errorEventOccurred = true;
4747
}
4848

4949
return event?.transaction === 'GET /test-expected-500-exception/:id';
5050
});
5151

52-
const transactionEventPromise400 = waitForTransaction('nestjs-basic', transactionEvent => {
52+
const transactionEventPromise400 = waitForTransaction('nestjs-11', transactionEvent => {
5353
return transactionEvent?.transaction === 'GET /test-expected-400-exception/:id';
5454
});
5555

56-
const transactionEventPromise500 = waitForTransaction('nestjs-basic', transactionEvent => {
56+
const transactionEventPromise500 = waitForTransaction('nestjs-11', transactionEvent => {
5757
return transactionEvent?.transaction === 'GET /test-expected-500-exception/:id';
5858
});
5959

@@ -74,15 +74,15 @@ test('Does not send HttpExceptions to Sentry', async ({ baseURL }) => {
7474
test('Does not send RpcExceptions to Sentry', async ({ baseURL }) => {
7575
let errorEventOccurred = false;
7676

77-
waitForError('nestjs-basic', event => {
77+
waitForError('nestjs-11', event => {
7878
if (!event.type && event.exception?.values?.[0]?.value === 'This is an expected RPC exception with id 123') {
7979
errorEventOccurred = true;
8080
}
8181

8282
return event?.transaction === 'GET /test-expected-rpc-exception/:id';
8383
});
8484

85-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
85+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
8686
return transactionEvent?.transaction === 'GET /test-expected-rpc-exception/:id';
8787
});
8888

@@ -101,15 +101,15 @@ test('Global exception filter registered in main module is applied and exception
101101
}) => {
102102
let errorEventOccurred = false;
103103

104-
waitForError('nestjs-basic', event => {
104+
waitForError('nestjs-11', event => {
105105
if (!event.type && event.exception?.values?.[0]?.value === 'Example exception was handled by global filter!') {
106106
errorEventOccurred = true;
107107
}
108108

109109
return event?.transaction === 'GET /example-exception-global-filter';
110110
});
111111

112-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
112+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
113113
return transactionEvent?.transaction === 'GET /example-exception-global-filter';
114114
});
115115

@@ -136,15 +136,15 @@ test('Local exception filter registered in main module is applied and exception
136136
}) => {
137137
let errorEventOccurred = false;
138138

139-
waitForError('nestjs-basic', event => {
139+
waitForError('nestjs-11', event => {
140140
if (!event.type && event.exception?.values?.[0]?.value === 'Example exception was handled by local filter!') {
141141
errorEventOccurred = true;
142142
}
143143

144144
return event?.transaction === 'GET /example-exception-local-filter';
145145
});
146146

147-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
147+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
148148
return transactionEvent?.transaction === 'GET /example-exception-local-filter';
149149
});
150150

dev-packages/e2e-tests/test-applications/nestjs-11/tests/span-decorator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
22
import { waitForTransaction } from '@sentry-internal/test-utils';
33

44
test('Transaction includes span and correct value for decorated async function', async ({ baseURL }) => {
5-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
5+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
66
return (
77
transactionEvent?.contexts?.trace?.op === 'http.server' &&
88
transactionEvent?.transaction === 'GET /test-span-decorator-async'
@@ -37,7 +37,7 @@ test('Transaction includes span and correct value for decorated async function',
3737
});
3838

3939
test('Transaction includes span and correct value for decorated sync function', async ({ baseURL }) => {
40-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
40+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
4141
return (
4242
transactionEvent?.contexts?.trace?.op === 'http.server' &&
4343
transactionEvent?.transaction === 'GET /test-span-decorator-sync'

dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
22
import { waitForTransaction } from '@sentry-internal/test-utils';
33

44
test('Sends an API route transaction', async ({ baseURL }) => {
5-
const pageloadTransactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
5+
const pageloadTransactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
66
return (
77
transactionEvent?.contexts?.trace?.op === 'http.server' &&
88
transactionEvent?.transaction === 'GET /test-transaction'
@@ -125,7 +125,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
125125
test('API route transaction includes nest middleware span. Spans created in and after middleware are nested correctly', async ({
126126
baseURL,
127127
}) => {
128-
const pageloadTransactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
128+
const pageloadTransactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
129129
return (
130130
transactionEvent?.contexts?.trace?.op === 'http.server' &&
131131
transactionEvent?.transaction === 'GET /test-middleware-instrumentation'
@@ -205,7 +205,7 @@ test('API route transaction includes nest middleware span. Spans created in and
205205
test('API route transaction includes nest guard span and span started in guard is nested correctly', async ({
206206
baseURL,
207207
}) => {
208-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
208+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
209209
return (
210210
transactionEvent?.contexts?.trace?.op === 'http.server' &&
211211
transactionEvent?.transaction === 'GET /test-guard-instrumentation'
@@ -268,7 +268,7 @@ test('API route transaction includes nest guard span and span started in guard i
268268
});
269269

270270
test('API route transaction includes nest pipe span for valid request', async ({ baseURL }) => {
271-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
271+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
272272
return (
273273
transactionEvent?.contexts?.trace?.op === 'http.server' &&
274274
transactionEvent?.transaction === 'GET /test-pipe-instrumentation/:id' &&
@@ -305,7 +305,7 @@ test('API route transaction includes nest pipe span for valid request', async ({
305305
});
306306

307307
test('API route transaction includes nest pipe span for invalid request', async ({ baseURL }) => {
308-
const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
308+
const transactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
309309
return (
310310
transactionEvent?.contexts?.trace?.op === 'http.server' &&
311311
transactionEvent?.transaction === 'GET /test-pipe-instrumentation/:id' &&
@@ -344,7 +344,7 @@ test('API route transaction includes nest pipe span for invalid request', async
344344
test('API route transaction includes nest interceptor spans before route execution. Spans created in and after interceptor are nested correctly', async ({
345345
baseURL,
346346
}) => {
347-
const pageloadTransactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
347+
const pageloadTransactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
348348
return (
349349
transactionEvent?.contexts?.trace?.op === 'http.server' &&
350350
transactionEvent?.transaction === 'GET /test-interceptor-instrumentation'
@@ -462,7 +462,7 @@ test('API route transaction includes nest interceptor spans before route executi
462462
test('API route transaction includes exactly one nest interceptor span after route execution. Spans created in controller and in interceptor are nested correctly', async ({
463463
baseURL,
464464
}) => {
465-
const pageloadTransactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
465+
const pageloadTransactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
466466
return (
467467
transactionEvent?.contexts?.trace?.op === 'http.server' &&
468468
transactionEvent?.transaction === 'GET /test-interceptor-instrumentation'
@@ -544,7 +544,7 @@ test('API route transaction includes exactly one nest interceptor span after rou
544544
test('API route transaction includes nest async interceptor spans before route execution. Spans created in and after async interceptor are nested correctly', async ({
545545
baseURL,
546546
}) => {
547-
const pageloadTransactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
547+
const pageloadTransactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
548548
return (
549549
transactionEvent?.contexts?.trace?.op === 'http.server' &&
550550
transactionEvent?.transaction === 'GET /test-async-interceptor-instrumentation'
@@ -629,7 +629,7 @@ test('API route transaction includes nest async interceptor spans before route e
629629
test('API route transaction includes exactly one nest async interceptor span after route execution. Spans created in controller and in async interceptor are nested correctly', async ({
630630
baseURL,
631631
}) => {
632-
const pageloadTransactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
632+
const pageloadTransactionEventPromise = waitForTransaction('nestjs-11', transactionEvent => {
633633
return (
634634
transactionEvent?.contexts?.trace?.op === 'http.server' &&
635635
transactionEvent?.transaction === 'GET /test-async-interceptor-instrumentation'

0 commit comments

Comments
 (0)