mocks

Community

Master unit isolation with precise test doubles.

Authorjs-rom
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Test doubles help isolate the code under test (SUT) from dependencies, speeding up unit tests and improving reliability by avoiding flaky external systems.

Core Features & Use Cases

  • Stub returns predefined outputs for given inputs and is ideal for state-based tests.
  • Mock defines interaction expectations (arguments, call counts, and sequence) and verifies them.
  • Spy combines stub behavior with interaction verification.
  • Dummy fills argument lists without participating in behavior.
  • Fake provides a lightweight in-memory implementation for simple scenarios.
  • Use Case: When testing a service that calls a repository, replace the repository with a stub or mock to verify behavior without touching the database.

Quick Start

Identify the DOCs involved, choose appropriate double types, and inject them into your unit tests to isolate the SUT.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: mocks
Download link: https://github.com/js-rom/Luis/archive/main.zip#mocks

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.