Skip to content

Simplify by requiring a single expectation - #675

Merged
lydell merged 1 commit into
masterfrom
simplify-expectations
Jul 19, 2026
Merged

Simplify by requiring a single expectation#675
lydell merged 1 commit into
masterfrom
simplify-expectations

Conversation

@lydell

@lydell lydell commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

The code partially supported test runner functions returning more than one expectation, which means more than one outcome of each test. But what does it mean to have multiple outcomes for a single test? How can it both pass and fail at the same time? Anyways, at the end we encoded the outcomes into a JSON object keyed by test ID. Duplicate keys in JSON are dropped when parsed, so we threw away all but one outcome.

Turns out test runner functions always return a list with exactly one expectation in practice: elm-explorations/test#244 (reverted because it unfortunately was a breaking change for the package: elm-explorations/test@11f70d5)

This PR simplifies by failing if a test somehow does not return exactly one expectation.

@lydell
lydell merged commit ec436a2 into master Jul 19, 2026
13 checks passed
@lydell
lydell deleted the simplify-expectations branch July 19, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant