| name | jazz-testing |
| description | Use this skill when you need to write, review, or debug automated tests for applications built on the Jazz framework. This skill provides the correct architectural patterns for simulating local-first synchronization and multi-user environments without resorting to invalid mocking strategies. |
Jazz Testing
When to Use This Skill
- Writing unit or integration tests for apps using Jazz
- Simulating synchronisation for testing purposes
- Verifying permissions and security logic
- Testing UI components in various application states (Guest/Anonymous/Authenticated/Online/Offline)
- Debugging failing tests
Do NOT Use This Skill For
- Designing the initial data schema (use
jazz-schema-design
- General React/Svelte UI layout questions unrelated to Jazz (for questions on Jazz integration with React/Svelte, use the
jazz-ui-development skill)
Key Heuristic for Agents
If you are about to suggest "mocking" any part of the data layer in the user's application, STOP and invoke this skill instead. This skill enforces the use of the official in-memory test sync node.
Core Concepts
Testing in Jazz requires understanding identity-based context and authentic synchronization. The framework's collaborative nature means tests must simulate real multi-user scenarios rather than mocking the sync layer.
Fundamental Principles
- NEVER Mock the Sync Layer: Avoid using generic mocking libraries (like Jest/Vitest mocks) for 'jazz-tools'
- In-Memory Synchronization: Always use a real in-memory sync node via
setupJazzTestSync() to allow authentic data flow between test identities
- Identity-Based Context: Testing in Jazz is about "who" is performing the action. Manage the "Active Account" explicitly to verify permissions and ownership