From 37535a05a7db85b66b8c8aac8c73db52dac74523 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 9 Dec 2022 11:29:06 +0100 Subject: [PATCH] ref: Add test for lastEventId --- packages/hub/test/hub.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/hub/test/hub.test.ts b/packages/hub/test/hub.test.ts index 5ce521ead4c4..595b983c0e25 100644 --- a/packages/hub/test/hub.test.ts +++ b/packages/hub/test/hub.test.ts @@ -4,6 +4,7 @@ import { Client, Event } from '@sentry/types'; import { getCurrentHub, Hub, Scope } from '../src'; +import { EventType } from '@sentry/types/build/types/event'; const clientFn: any = jest.fn(); @@ -358,10 +359,11 @@ describe('Hub', () => { expect(args[1].event_id).toEqual(hub.lastEventId()); }); - test('transactions do not set lastEventId', () => { + const eventTypesToIgnoreLastEventId: EventType[] = ['transaction', 'replay_event']; + it.each(eventTypesToIgnoreLastEventId)('eventType %s does not set lastEventId', eventType => { const event: Event = { extra: { b: 3 }, - type: 'transaction', + type: eventType, }; const testClient = makeClient(); const hub = new Hub(testClient);