rd13_copilot_setup/prompts/write-tests.prompt.md
Conrad Schulz 9838c7a0b3 feat: initial copilot workspace setup
- User settings.json with 9 senior-dev behavior rules
- 9 prompt files: requirements, architecture, new-feature, code-review,
  debug, refactor, write-tests, done-check, docker
- git-templates for .github/ and .vscode/ auto-copy on git init
- deploy.sh (macOS/bash) and deploy.fish (Linux/fish) scripts
- copilot-bootstrap.fish for existing/cloned repos
2026-05-29 08:19:50 +00:00

34 lines
1.1 KiB
Markdown
Raw Permalink 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.

---
mode: agent
description: Tests schreiben Unit, Integration oder E2E für bestehenden Code
tools:
- codebase
- editFiles
- runCommands
- problems
---
# Tests schreiben
**Ziel:** ${input:target:Welcher Code soll getestet werden?}
**Test-Typ:** ${input:test_type:unit / integration / e2e}
## Strategie
1. **Analyse** Bestehende Tests lesen, Test-Framework und Patterns verstehen
2. **Coverage-Lücken** Welche Fälle sind ungetestet?
3. **Test-Cases** Happy Path + Edge Cases + Error Cases definieren
4. **Implementierung** Tests schreiben, bestehende Patterns und Helpers nutzen
5. **Ausführen** Tests laufen grün
## Gute Tests
- **Arrange / Act / Assert** klare Struktur
- Ein Test = eine Assertion (oder eng verwandte Gruppe)
- Test-Namen beschreiben das erwartete Verhalten: `should return empty array when input is null`
- Keine Implementation Details testen nur Verhalten
- Keine Mocks wo Echte Objekte möglich sind
## Nicht erwünscht
- Tests die nur Code paraphrasieren ohne Mehrwert
- Fragile Tests die bei jedem Refactor brechen
- Tests mit versteckten Abhängigkeiten zwischen sich