Skip to content

fix(testing): allow Conformance.runSpec with zero case modules - #165

Merged
krisnye merged 2 commits into
mainfrom
knye/run-spec-empty-suite
Aug 8, 2026
Merged

fix(testing): allow Conformance.runSpec with zero case modules#165
krisnye merged 2 commits into
mainfrom
knye/run-spec-empty-suite

Conversation

@krisnye

@krisnye krisnye commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Conformance.runSpec previously registered no Vitest suites when discovery found no modules exporting cases, so empty-State spec.test.ts files failed with "No test suite found".
  • Empty discovery now registers a single no-op (has no pure transitions to specify), matching the intended "always keep a one-line spec.test.ts" pattern for features without pure transforms.
  • Skips empty cases: [] modules so they do not open suite-less describe blocks.
  • Adds regression tests for empty transitions, empty cases arrays, and a normal transition pairing.

Test plan

  • pnpm exec vitest --run --project node src/testing/conformance/run-spec in packages/data
  • Confirm a feature with empty State + only Conformance.runSpec({ transitions }) passes without --passWithNoTests

Made with Cursor

krisnye and others added 2 commits August 7, 2026 23:34
Features with empty State still ship a one-line spec.test.ts that calls
runSpec. When discovery finds no cases, Vitest previously failed the
file with "No test suite found". Register a no-op sentinel instead so
empty discovery is a valid outcome.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@krisnye
krisnye merged commit 0a48305 into main Aug 8, 2026
3 checks passed
@krisnye
krisnye deleted the knye/run-spec-empty-suite branch August 8, 2026 06:49
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