feat: version 2 beta
This commit is contained in:
17
tests/adapters/utilities/describe.ts
Normal file
17
tests/adapters/utilities/describe.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe as desc } from "@std/testing/bdd";
|
||||
|
||||
import { EventFactory } from "../../../libraries/event-factory.ts";
|
||||
import { EventStore, type EventStoreHooks } from "../../../libraries/event-store.ts";
|
||||
import { Projector } from "../../../libraries/projector.ts";
|
||||
|
||||
export function describe<TEventFactory extends EventFactory>(
|
||||
name: string,
|
||||
runner: (getEventStore: EventStoreFn<TEventFactory>) => void,
|
||||
): (getEventStore: EventStoreFn<TEventFactory>) => void {
|
||||
return (getEventStore: EventStoreFn<TEventFactory>) => desc(name, () => runner(getEventStore));
|
||||
}
|
||||
|
||||
type EventStoreFn<TEventFactory extends EventFactory> = (options?: { hooks?: EventStoreHooks<TEventFactory> }) => Promise<{
|
||||
store: EventStore<TEventFactory, any, any>;
|
||||
projector: Projector<TEventFactory>;
|
||||
}>;
|
||||
Reference in New Issue
Block a user