feat(data-testing): add throws support to conformance cases - #186
Merged
Conversation
A `Case` can now declare `throws: true | "substring"` instead of `after`/`effects` to assert a transition/action rejects its input, honored uniformly by runSpec, runTransactions, and runActions. Also fixes discoverTransitions to recognize a module whose first case is throws-only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Casecan now declarethrows: true | "substring"instead ofafter/effects, asserting a transition/action rejects its input — honored uniformly byrunSpec,runTransactions, andrunActionsvia a sharedexpectThrowshelper.discoverTransitionsto recognize adata/state/module whose first case is throws-only (previously only"after" in casewas checked, so such a module would silently fail to be discovered as a transition).data-airules (state.md,conformance.md) now describe thethrowscase shape and its intended, narrow use (genuine precondition rejection — not the default "guard no-op, return{}" style).Test plan
pnpm -r run typecheckclean across the monorepopnpm -r run testclean across the monorepoexpectThrows(expect-throws.test.ts)run-spec.test.tsexercisingthrows: trueandthrows: "substring"through the realrunSpecrunnercases.type-test.tsconfirmingthrowscases type-check andafter+throwstogether is rejected🤖 Generated with Claude Code