Skip to content

Commit

Permalink
ref: Add test for lastEventId
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Dec 9, 2022
1 parent d5941d3 commit 37535a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/hub/test/hub.test.ts
Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 37535a0

Please sign in to comment.