test-mocking

Replace real dependencies with mocks, stubs, fakes, or spies in unit tests.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/Luscii/terraform-fluentbit-luscii-presets --skill test-mocking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-mocking
Source: https://github.com/Luscii/terraform-fluentbit-luscii-presets/tree/main/.github/skills/test-mocking
Command: npx skills add https://github.com/Luscii/terraform-fluentbit-luscii-presets --skill test-mocking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers isolate code under test by replacing real dependencies with mock alternatives, enabling faster, deterministic unit tests.

Core Features & Use Cases

  • Mock external services to verify interactions without hitting real dependencies.
  • Use stubs, fakes, or spies to control behavior and data.
  • Apply across languages and frameworks to improve test reliability and speed.

Quick Start

Identify external dependencies in a unit test, choose a mocking strategy (mock, stub, fake, or spy), implement the mocks in your test suite, and run the tests to verify expected behavior.

Frequently Asked Questions about test-mocking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate unit tests by mocking external dependencies?

To isolate unit tests, you replace real dependencies like databases or APIs with mock alternatives such as stubs, fakes, or spies, enabling faster and deterministic behavior verification without hitting actual services.

What is the difference between using stubs, fakes, and spies for test doubles?

Test doubles control behavior and data during unit testing. Stubs provide predefined responses, fakes implement simplified working logic, and spies record interaction details, allowing precise verification of how external services are called.

How do I mock database and API services to verify interactions in unit tests?

You mock database and API services by implementing test doubles that intercept calls, returning controlled data while tracking interactions. This verifies expected behavior without requiring live network connections or real database state.

Does this mocking approach work across different languages and unit-testing frameworks?

Yes, this approach applies to unit-test scenarios across languages and frameworks, covering mocking, stubs, fakes, and spies to improve test reliability and speed regardless of your specific development stack.

When should I use mocks instead of real dependencies in my unit tests?

Use mocks when you need deterministic behavior and clear verification of interactions without the latency or instability of real databases, APIs, or services, ensuring faster and more reliable test execution.