alpha
Login
or
Join now
nandi.uk
/
semble
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
update fake event publisher
author
Wesley Finck
date
1 year ago
(Jul 31, 2025, 11:28 AM -0500)
commit
c6d22a5c
c6d22a5c729a77027730486d45687a659ec252b1
parent
57204cea
57204cea3542530b42bf279e61fdc8f7fa90e6ed
+5
-2
1 changed file
Expand all
Collapse all
Unified
Split
src
modules
cards
tests
utils
FakeEventPublisher.ts
+5
-2
src/modules/cards/tests/utils/FakeEventPublisher.ts
View file
Reviewed
···
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
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
22
-
getPublishedEventsOfType<T extends IDomainEvent>(eventType: new (...args: any[]) => T): T[] {
23
23
-
return this.publishedEvents.filter(event => event instanceof eventType) as T[];
23
23
+
getPublishedEventsOfType<T extends IDomainEvent>(eventType: EventName): T[] {
24
24
+
return this.publishedEvents.filter(
25
25
+
(event) => event.eventName === eventType,
26
26
+
) as T[];
24
27
}
25
28
26
29
setShouldFail(shouldFail: boolean): void {