Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Diagnostics

Every diagnostic has a code, a place and usually a hint. Errors stop the suite loading. Warnings don’t, but most of them mean something won’t be tested or documented.

error[bad-value]: `boiling` isn't a value of the kettle
  --> heating.expect:9
   |     Then the kettle is boiling
   = help: the kettle is one of: off, starting, heating, dry

The language

CodeMeans
syntaxerrorA line that isn’t part of the language here: a keyword in the wrong place, or a missing name.
empty-suiteerrorThe directory has no .expect files.
unknown-steperrorA step that’s neither a declared state nor a declared event. The hint suggests the closest.
bad-valueerrorA value the state doesn’t have, a number outside its range, or a comparison that doesn’t fit.
bad-stateerrorA state declaration that can’t be read, or one declared twice differently.
bad-eventerrorAn event with no name.
bad-phraseerrorA phrase that mixes Givens and Whens, or has no steps.
bad-overrideerrorOverrides: names an expectation that doesn’t exist.
duplicateerrorTwo expectations, terms or other named things with the same name.
two-nameserror / warningA section named twice (error), or the suite named twice (warning).
no-thenerrorAn expectation with no Then.
contradictionerrorSteps in one condition that can’t hold together (“off” and “heating”).
misplaced-eventerrorAn event in a Given or a Then. Events only happen in a When.
misplaced-shifterrorA relative step (“goes up by 1”) anywhere but an expectation’s Then.
two-eventserrorOne action with two events. Put a Then between them, or split the step.
empty-storyerrorA story or scenario with no steps.
maybe-stepwarningDescription text that looks like a misspelled step (“Gvien the kettle is off”).
says-nothingwarningA step that’s true of every value (“off or heating” of a state with only those).
shows-whatwarningA Shows: line that doesn’t say which value it’s for.

Platforms

CodeMeans
unknown-platformerrorA tag or On: naming a platform that isn’t declared, or any platform in a suite that declares none.
default-platformerrorA tag for the default platform. Write its lines plainly.

Conflicts and the graph

CodeMeans
conflicterrorTwo expectations can both apply and promise contradicting things. The note names where they overlap; the hint suggests which is the exception.
override-cycleerrorOverrides that go round in a circle.
unneeded-overridewarningAn override between two expectations that never disagree.
unreachablewarningNo chain of expectations gets the system into this expectation’s Given, so nothing can test it.
no-way-inwarningNothing leads from a section’s parent into the section, so the docs can’t say how to get there.

Stories

CodeMeans
unclear-steperrorThe step might set off an expectation, and the story doesn’t pin down whether.
unspecifiederrorAn event happens and no expectation says what it does.
contradictserrorA Then in the story contradicts what the expectations say.
clasherrorTwo expectations fire at this step and disagree. Settle the conflict first.
unpromisedwarningA Then in the story that no expectation promises. It’s checked anyway.
untestedwarningNo story exercises this expectation. The hint is a story that would.