Skip to content

Commit 4e07ba3

Browse files
committed
Add CommandDependencies to test frameworkify
1 parent 38297d2 commit 4e07ba3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/commands/area/create.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {constructEvent} from '../../types';
22
import * as RA from 'fp-ts/ReadonlyArray';
3+
import * as TE from 'fp-ts/TaskEither';
34
import * as t from 'io-ts';
45
import * as tt from 'io-ts-types';
56
import * as O from 'fp-ts/Option';
@@ -20,7 +21,8 @@ const process: Command<CreateArea>['process'] = input =>
2021
RA.match(
2122
() => O.some(constructEvent('AreaCreated')(input.command)),
2223
() => O.none
23-
)
24+
),
25+
TE.right,
2426
);
2527

2628
const resource: Command<CreateArea>['resource'] = command => ({

tests/read-models/test-framework.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {getSheetData, getSheetDataByMemberNumber} from '../../src/sync-worker/db
2828
import {TrainingSummaryDeps} from '../../src/sync-worker/training-summary/training-summary-deps';
2929
import {NonEmptyString} from 'io-ts-types/lib/NonEmptyString';
3030
import { excludeEvent } from '../../src/init-dependencies/event-store/exclude-event';
31+
import { CommandDependencies } from '../../src/commands/command';
3132

3233
const TROUBLE_TICKET_SHEET_ID = 'trouble_ticket_sheet_id';
3334

@@ -37,6 +38,7 @@ type ToFrameworkCommands<T> = {
3738
process: (input: {
3839
command: infer C;
3940
events: ReadonlyArray<DomainEvent>;
41+
deps: CommandDependencies;
4042
}) => unknown;
4143
}
4244
? (c: Omit<C, 'actor'> & { actor?: Actor }) => Promise<void>

0 commit comments

Comments
 (0)