mocktail
Installation
SKILL.md
Mocktail Skill
This skill defines how to correctly use the mocktail package for mocking in Dart and Flutter tests.
1. Mock vs. Fake vs. Real Object
| Use | When |
|---|---|
| Real object | Prefer over mocks when practical. |
Fake (extends Fake) |
Lightweight custom implementation; override only the methods you need. Prefer over mocks when you don't need interaction verification. |
Mock (extends Mock) |
Only when you need to verify interactions (call counts, arguments) or stub dynamic responses. |
- Never add
@overridemethods or implementations to a class extendingMock. - Only use mocks if your test has
verifyassertions; otherwise prefer real or fake objects.