Skip to content

Skill: Testing Electric apps (unit + integration) #3915

@KyleAMathews

Description

@KyleAMathews

Context

Testing Electric apps requires different strategies for unit tests (mocked fetch) vs integration tests (real Electric server + Postgres). The integration test setup involves Docker, multiple services, and specific configuration.

Scope

Create an electric-testing skill covering:

  1. Unit testing — Mocking fetchClient with vi.fn(), testing collection behavior without network
  2. Integration test setup — Docker Compose for Postgres + Electric + nginx, port configuration
  3. Building local Electric image — When to use canary vs local build
  4. Test database management — Schema setup, teardown, test isolation
  5. Testing patterns — Testing optimistic mutations, testing live query reactivity, testing error recovery
  6. CI configuration — GitHub Actions / similar with Electric services

Source

Identified during domain discovery skill test run. Integration test setup is a distinct developer task with non-trivial infrastructure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions