Mocking and stubbing are essential techniques for isolating units of code during testing by replacing dependencies with controlled test doubles. This enables fast, reliable, and focused unit tests that don't depend on external systems like databases, APIs, or file systems.
See also: integration-testing, test-data-generation, test-automation-framework for complete testing patterns.
Crea e gestisci mock, stub, spie e test doppi per isolare gli unit test dalle dipendenze esterne. Utilizzare per mock, stub, spy, test double, Mockito, Jest mock e isolamento delle dipendenze. Fonte: aj-geddes/useful-ai-prompts.
Apri il tuo terminale o strumento da riga di comando (Terminal, iTerm, Windows Terminal, ecc.) Copia ed esegui questo comando: npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill mocking-stubbing Dopo l'installazione, la skill verrà configurata automaticamente nel tuo ambiente AI di coding e sarà pronta all'uso in Claude Code, Cursor o OpenClaw