Skip to content

Commit 7ba1fbd

Browse files
committed
test payload tags
1 parent 29452e5 commit 7ba1fbd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/src/listeners/test-event.listener.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Injectable } from '@nestjs/common';
22
import { OnEvent } from '@nestjs/event-emitter';
3+
import * as Sentry from '@sentry/nestjs';
34

45
@Injectable()
56
export class TestEventListener {
@@ -17,6 +18,7 @@ export class TestEventListener {
1718
@OnEvent('multiple.first')
1819
@OnEvent('multiple.second')
1920
async handleMultipleEvents(payload: any): Promise<void> {
21+
Sentry.setTag('payload', payload);
2022
await new Promise(resolve => setTimeout(resolve, 100));
2123
}
2224
}

dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/events.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ test('Multiple OnEvent decorators', async () => {
5555
const firstTx = await firstTxPromise;
5656
const secondTx = await secondTxPromise;
5757

58-
expect(firstTx).toBeDefined();
59-
expect(secondTx).toBeDefined();
58+
expect(firstTx.tags).toMatchObject({ payload: { data: 'test-first' } });
59+
expect(secondTx.tags).toMatchObject({ payload: { data: 'test-second' } });
6060
});

0 commit comments

Comments
 (0)