mocktail
Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail).
npx skills add evanca/flutter-ai-rules --skill mocktail --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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 `@override` methods or implementations to a class extending `Mock`. - Only use mocks if your test has `verify` assertions; otherwise prefer real or fake objects. --- ## 2. Creating Mocks ```dart class MockMyService extends Mock implements MyService {} class FakeMyEvent extends Fake implements MyEvent {} ``` No code generation required — unlike Mockito, Mocktail uses `noSuchMethod` at runtime. --- ## 3. Registering Fallback Values Register fallback values **before** using custom types with argument matchers. Do this in `setUpAll` or at the top of your test: ```dart setUpAll(() { registerFallbackValue(FakeMyEvent()); }); ``` - Required for non-n
- 1. Mock vs. Fake vs. Real Object
- 2. Creating Mocks
- 3. Registering Fallback Values
- 4. Stubbing
- 5. Named Parameters
- 6. Verification
- 7. Argument Matchers
- References
What does the mocktail skill do?
Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail).
How do I install it?
Run `npx skills add evanca/flutter-ai-rules --skill mocktail --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From evanca/flutter-ai-rules, a repository with 604 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
