Skip to content

Commit daf52f4

Browse files
committed
fix e2e test
1 parent 146da2c commit daf52f4

File tree

1 file changed

+10
-5
lines changed
  • packages/e2e-tests/test-applications/node-express-app/src

1 file changed

+10
-5
lines changed

packages/e2e-tests/test-applications/node-express-app/src/app.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ import '@sentry/tracing';
33
import * as Integrations from '@sentry/integrations';
44
import express from 'express';
55

6+
declare global {
7+
namespace globalThis {
8+
var transactionIds: string[];
9+
}
10+
}
11+
612
Sentry.init({
7-
dsn: process.env.SENTRY_DSN,
13+
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN,
814
integrations: [new Integrations.HttpClient()],
915
debug: true,
1016
tracesSampleRate: 1,
@@ -36,7 +42,7 @@ app.get('/test-transaction', async function (req, res) {
3642
await Sentry.flush();
3743

3844
res.send({
39-
transactionIds: (global as typeof global & { transactionIds: string[] }).transactionIds || [],
45+
transactionIds: global.transactionIds || [],
4046
});
4147
});
4248

@@ -53,14 +59,13 @@ app.listen(port, () => {
5359
});
5460

5561
Sentry.addGlobalEventProcessor(event => {
56-
(global as typeof global & { transactionIds: string[] }).transactionIds =
57-
(global as typeof global & { transactionIds: string[] }).transactionIds || [];
62+
global.transactionIds = global.transactionIds || [];
5863

5964
if (event.type === 'transaction') {
6065
const eventId = event.event_id;
6166

6267
if (eventId) {
63-
(global as typeof global & { transactionIds: string[] }).transactionIds.push(eventId);
68+
global.transactionIds.push(eventId);
6469
}
6570
}
6671

0 commit comments

Comments
 (0)