alolo777/pos/mocktail
Claude Code and agent skill by alolo777/pos
- community
Checking that the SKILL.md file is still in the repository.
Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail).
Install
npx vskill@latest install alolo777/pos/mocktailSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/mocktail.
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.
2. Creating Mocks
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:
- Required for non-nullable custom types used with
any(),captureAny(), orcaptureThat(). - Register fallback values for any custom type used with argument matchers.
4. Stubbing
- Always stub async methods (returning
FutureorFuture<void>) withthenAnswer. - Stub every method you expect to be called, even if it's not the focus of your test.
5. Named Parameters
Always include all named parameters in both when and verify calls. Use any(named: 'paramName') for those you don't care about:
- If a method has default values for named parameters, Mocktail still expects them all to be matched.
6. Verification
7. Argument Matchers
- Use
any()for positional parameters when you don't care about the exact value. - Use
captureThat()for conditional capturing. - When matching string output, be aware of what
.toString()returns for the type.
References
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpos_flutter_firebase/.opencode/skills/mocktail/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alolo777/pos/mocktail)