agentsclimarketplace

Mocking

Skill kimtth/agent-skill-100-lines-or-less/skills/mocking

Use when: use test doubles correctly — mock true boundaries, not the code under test.From its SKILL.md

Install
npx -y skills add kimtth/agent-skill-100-lines-or-less --skill mocking

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.1 KB, 205 tokens by cl100k_base, as published. Nobody here has run it

Goal: fast, honest tests that isolate the unit without faking its behavior.

Use for:

  • isolating a unit from slow or external dependencies
  • deciding what to fake versus exercise for real
  • fixing brittle tests coupled to implementation

Workflow:

  1. Identify the true external boundary (network, clock, filesystem).
  2. Mock or stub only that boundary, not internal collaborators.
  3. Use the lightest double that works: stub, fake, or mock.
  4. Assert on observable behavior, not on every internal call.
  5. Keep doubles in sync with the real contract.
  6. Verify the integration with the real dependency elsewhere.

Doubles:

  • stub: returns canned data
  • fake: a working lightweight implementation
  • mock: asserts interactions occurred
  • spy: records calls for later inspection

Rules:

  • do not mock the thing you are testing
  • prefer real collaborators when they are fast and deterministic
  • avoid asserting on internal call sequences
  • verify mocked contracts against reality in integration tests

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,834. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.