mockito
Use when generating mocks, stubbing methods, verifying interactions, capturing arguments, or choosing between mocks, fakes, and real objects (Mockito).
npx skills add evanca/flutter-ai-rules --skill mockito --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.
# Mockito Skill This skill defines how to correctly use the `mockito` 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. | - **Data models** should not be mocked if they can be constructed with stubbed data. - Only use mocks if your test has `verify` assertions; otherwise prefer real or fake objects. --- ## 2. Generating Mocks ```dart @GenerateMocks([MyClass]) // or for nice mocks (return simple legal values for missing stubs): @GenerateNiceMocks([MockSpec<MyClass>()]) void main() { ... } ``` ```bash dart run build_runner build ``` - Only annotate files under `test/` for mock generation by default. - Use a `build.yaml` if you need to generate mocks outside of `test/`. - Never add `@override` methods or implementations to a class extending `Mock`. - Never stub responses in a moc
- 1. Mock vs. Fake vs. Real Object
- 2. Generating Mocks
- 3. Stubbing
- 4. Verification
- 5. Argument Matchers
- 6. Capturing Arguments
- 7. Resetting Mocks
- 8. Mocking Function Types
- 9. Debugging
- References
dart run build_runner build
What does the mockito skill do?
Use when generating mocks, stubbing methods, verifying interactions, capturing arguments, or choosing between mocks, fakes, and real objects (Mockito).
How do I install it?
Run `npx skills add evanca/flutter-ai-rules --skill mockito --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.
