Function: expectBehavior()

August 8, 2026 ยท View on GitHub

@plures/praxis


@plures/praxis / index / expectBehavior

Function: expectBehavior()

expectBehavior(name): Expectation

Defined in: src/expectations/expectations.ts:130

Create a new behavioral expectation.

Parameters

name

string

Unique name for this expectation (e.g. 'settings-saved-toast')

Returns

Expectation

A chainable Expectation builder with onlyWhen(), never(), and always() methods

Example

expectBehavior('settings-saved-toast')
  .onlyWhen('settings.diff is non-empty')
  .never('when save fails')
  .always('includes which settings changed');