Files
Jellyfin_Request_tvandmovies/.cursor/rules/testing-standards.mdc
T
2026-08-02 16:12:17 -04:00

18 lines
866 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: Testing standards — structure, naming, and what to cover
globs: **/*.{test,spec}.{ts,tsx,js,jsx,py}
alwaysApply: false
---
# Testing Standards
- Test behavior, not implementation details. Assert outputs and side effects users care about.
- Follow Arrange–Act–Assert (or Given–When–Then) structure.
- One assertion concept per test. Name tests: `should <expected> when <condition>`.
- Cover happy path, edge cases, and at least one failure case per feature.
- Mock external services (APIs, DB, email) — never call real third parties in unit tests.
- Do not test framework internals or trivial getters with no logic.
- Keep tests independent: no shared mutable state between tests.
- Prefer factory helpers or fixtures over copy-pasted setup blocks.
- Flaky tests are bugs — fix or delete them, do not `@skip` without a tracked issue.