Skip to content

Release v4.1.0

Choose a tag to compare

@github-actions github-actions released this 27 Nov 11:55
d188d1e

Specs for events, read models and reactors can now state one behavior in the shape of a Specification, the Elixir counterpart of the C# scenario family.

Added

  • Cratis.Chronicle.Testing.EventScenario: given events, append once, then one should_* expectation per test (should_have_constraint_violation, should_have_concurrency_violation, should_have_appended, should_have_appended_exactly, should_have_tail_sequence_number, ...). Only what the append (and the reactors it triggered) added counts, not the given events.
  • Cratis.Chronicle.Testing.ReadModelScenario: should_have_read_model for a read model built by a projection (evaluated in memory) or by a reducer, asked for by module and key, matched by struct, sub-map or predicate.
  • Cratis.Chronicle.Testing.ReactorScenario: the events a reactor produced and should_have_observer_failures for a reactor that is expected to fail.
  • The kernel starts once per spec module (lifecycle: :shared, the default) or once per test (lifecycle: :per_test).
  • Specs in for_*/when_* folders with no _test suffix: this project's mix.exs shows the test_load_filters that finds them.

Fixed

  • The in-memory kernel answered a constraint violation when appending several events with the response type of a single append, which could not be encoded, so EventLog.append_many/3 raised instead of returning the violation.