This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

update fake event publisher

+5 -2
+5 -2
src/modules/cards/tests/utils/FakeEventPublisher.ts
··· 1 1 import { IEventPublisher } from '../../../../shared/application/events/IEventPublisher'; 2 2 import { IDomainEvent } from '../../../../shared/domain/events/IDomainEvent'; 3 3 import { Result, ok, err } from '../../../../shared/core/Result'; 4 + import { EventName } from 'src/shared/infrastructure/events/EventConfig'; 4 5 5 6 export class FakeEventPublisher implements IEventPublisher { 6 7 private publishedEvents: IDomainEvent[] = []; ··· 19 20 return [...this.publishedEvents]; 20 21 } 21 22 22 - getPublishedEventsOfType<T extends IDomainEvent>(eventType: new (...args: any[]) => T): T[] { 23 - return this.publishedEvents.filter(event => event instanceof eventType) as T[]; 23 + getPublishedEventsOfType<T extends IDomainEvent>(eventType: EventName): T[] { 24 + return this.publishedEvents.filter( 25 + (event) => event.eventName === eventType, 26 + ) as T[]; 24 27 } 25 28 26 29 setShouldFail(shouldFail: boolean): void {