Craft Expectation Chain

Crafting expectation chains. Fluent assertions without traps.

attac-t Updated

File contents

Skill: Craft Expectation Chain

"Chains compose. Nesting doesn't."

The Standard

  1. One Subject, Many Assertions: Chain assertions on the same value.
  2. and() for New Subjects: Switch subjects explicitly.
  3. Break Nested Collections: ->each-> allows ONE assertion. No deeper.

The Anti-Patterns

Don't Do Why
->each->prop->each-> Separate expectations Proxy limitation
Multiple expect() for same value Chain assertions Fluency
Implicit subject switches Use ->and() Clarity

Real-World Examples

See examples.md.

attac-t/the-foundry/tree/main/plugins/pest/skills/craft-expectation-chain commit 1192743f9f

Frequently asked questions

npx skillmds@latest add attac-t/craft-expectation-chain