Skip to content

Add vitest coverage for workflows-db.ts run persistence #32

@aitrace-dev

Description

@aitrace-dev

Context

packages/backend/src/workflows-db.ts persists workflow definitions and run history. It has no dedicated unit test. A focused vitest suite covering create / read / list / run-persistence would catch the 80% of bugs that matter.

Acceptance criteria

  • New file packages/backend/src/workflows-db.test.ts
  • Covers: create workflow, fetch by id, list workflows, record a run, list runs for a workflow, updating a workflow doesn't orphan its runs
  • Uses an in-memory SQLite instance (no temp files)
  • Passes with npm run test -w @granclaw/backend

Pointers

  • packages/backend/src/workflows-db.test.ts (new)
  • Existing patterns in packages/backend/src/*.test.ts

Difficulty

~2 hours. Good introduction to the SQLite layer.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions