applyCommand<I extends Input, O extends Output> function

Future<O> applyCommand<I extends Input, O extends Output>(
  1. Command<I, O> command
)

Performs command and returns the Output it describes.

The shape most tests want. Returns O, not Output, so a test can assert on the command's own fields without casting first.

Command.describe is called even when the run stopped early, exactly as the framework calls it, so a test can assert what a half-finished command reports.

Implementation

Future<O> applyCommand<I extends Input, O extends Output>(
  Command<I, O> command,
) async => command.describe(await runCommand(command));