testing-essentials

Installation
SKILL.md

Testing Essentials

Use this skill before writing ANY _test.exs file.

RULES — Follow these with no exceptions

  1. Follow the project's existing test setup patterns — don't inline DataCase/ConnCase boilerplate that the project already abstracts away
  2. Test both happy path AND error/invalid cases for every function
  3. Use async: true only when safe — safe: pure functions, changesets, helpers; unsafe: DB contexts with shared rows, LiveView, Application.put_env, external services
  4. Define test data in fixtures (test/support/) — never build it inline across multiple tests
  5. Use has_element?/2 and element/2 for LiveView assertions — not html =~ "text" for structure checks
  6. Always test the unauthorized case for any protected resource
  7. Never hardcode dates — use relative timestamps to prevent flaky tests

Workflow: Writing a New Test File

Installs
2
First Seen
2 days ago
testing-essentials — igmarin/elixir-phoenix-skills