electric-sql / electric-sql/electric
Skill: Testing Electric apps (unit + integration)
- Dominant language
- TypeScript
- Stars
- 10.4k
- Forks
- 375
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 18
Description
## 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.
Contributor guide
Assessment
This issue has not been assessed yet.