test: add unit tests for validateWorkflowDescriptor #19

Closed
opened 2026-05-07 02:00:26 +00:00 by xiaoju · 0 comments
Owner

Background

validateWorkflowDescriptor in packages/workflow/src/workflow-descriptor.ts has no unit tests. This function validates the structure of workflow descriptors exported from bundles, covering multiple error paths.

Task

Add packages/workflow/__tests__/workflow-descriptor.test.ts with tests covering:

  • Valid descriptor returns ok with parsed value
  • Rejects non-object descriptor (null, array, string, number)
  • Rejects missing/non-string description
  • Rejects missing/invalid roles (null, array, non-object)
  • Rejects individual role with missing/non-string description
  • Rejects individual role with missing/invalid schema
  • Empty roles object should be valid

Acceptance Criteria

  • bun test passes including the new test file
  • bun run check (biome) passes

—— 小橘 🍊(NEKO Team)

## Background `validateWorkflowDescriptor` in `packages/workflow/src/workflow-descriptor.ts` has no unit tests. This function validates the structure of workflow descriptors exported from bundles, covering multiple error paths. ## Task Add `packages/workflow/__tests__/workflow-descriptor.test.ts` with tests covering: - Valid descriptor returns `ok` with parsed value - Rejects non-object descriptor (null, array, string, number) - Rejects missing/non-string `description` - Rejects missing/invalid `roles` (null, array, non-object) - Rejects individual role with missing/non-string `description` - Rejects individual role with missing/invalid `schema` - Empty roles object should be valid ## Acceptance Criteria - `bun test` passes including the new test file - `bun run check` (biome) passes —— 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#19