CtrlK
BlogDocsLog inGet started
Tessl Logo

generating-test-doubles

This skill uses the test-doubles-generator plugin to automatically create mocks, stubs, spies, and fakes for unit testing. It analyzes dependencies in the code and generates appropriate test doubles based on the chosen testing framework, such as Jest, Sinon, or others. Use this skill when you need to generate test doubles, mocks, stubs, spies, or fakes to isolate units of code during testing. Trigger this skill by requesting test double generation or using the `/gen-doubles` or `/gd` command.

Install with Tessl CLI

npx tessl i github:jeremylongshore/claude-code-plugins-plus-skills --skill generating-test-doubles
What are skills?

91

1.00x

Quality

60%

Does it follow best practices?

Impact

97%

1.00x

Average score across 9 eval scenarios

Optimize this skill with Tessl

npx tessl skill review --optimize ./backups/skills-migration-20251108-070147/plugins/testing/test-doubles-generator/skills/test-doubles-generator/SKILL.md
SKILL.md
Review
Evals

Evaluation results

100%

Weather Dashboard: Unit Tests for Data Fetching Layer

Jest mock generation for HTTP dependencies

Criteria
Without context
With context

Dependency identified

100%

100%

Jest framework used

100%

100%

Mock type chosen

100%

100%

Simulates API response

100%

100%

Paste-ready code

100%

100%

Behavior verification

100%

100%

No Sinon or other lib

100%

100%

Source code analysed

100%

100%

Without context: $0.3741 · 1m 39s · 24 turns · 30 in / 5,124 out tokens

With context: $0.5451 · 2m 1s · 30 turns · 294 in / 6,525 out tokens

100%

Order Processing Service: Isolating the Email Dependency

Sinon stub generation for service dependencies

Criteria
Without context
With context

Sinon framework used

100%

100%

Stub type chosen

100%

100%

Dependency identified

100%

100%

Controlled response

100%

100%

Paste-ready code

100%

100%

Stub restored or sandbox used

100%

100%

No Jest APIs used

100%

100%

Source code analysed

100%

100%

Without context: $0.4185 · 1m 33s · 26 turns · 33 in / 5,469 out tokens

With context: $0.5741 · 2m 5s · 32 turns · 36 in / 7,253 out tokens

100%

Analytics Middleware: Verifying Logging Calls Without Breaking Behavior

Spy usage for interaction tracking

Criteria
Without context
With context

Spy type chosen

100%

100%

Real implementation preserved

100%

100%

Interaction verified

100%

100%

Dependency from source

100%

100%

Paste-ready code

100%

100%

Notes explain type choice

100%

100%

Spy cleanup

100%

100%

Without context: $0.4557 · 1m 58s · 26 turns · 30 in / 6,402 out tokens

With context: $0.5557 · 2m 15s · 29 turns · 293 in / 6,695 out tokens

100%

Inventory Service: Unit Tests with Isolated Storage

Fake implementation for stateful dependency

Criteria
Without context
With context

Fake type used

100%

100%

Interface matches source

100%

100%

Stateful behaviour preserved

100%

100%

Paste-ready code

100%

100%

No mock/stub APIs used

100%

100%

Dependency identified from source

100%

100%

Test exercises the unit

100%

100%

Notes explain type choice

100%

100%

Without context: $0.3085 · 1m 36s · 18 turns · 25 in / 5,251 out tokens

With context: $0.6411 · 2m 40s · 32 turns · 268 in / 8,293 out tokens

96%

Payment Processor: Unit Tests for a Multi-Dependency Service

Framework selection and test double type choice

Criteria
Without context
With context

Framework stated

100%

100%

Mock used for verification dependency

100%

100%

Stub used for controlled-response dependency

73%

73%

Type choice explained

100%

100%

Consistent framework APIs

100%

100%

Dependency names match source

100%

100%

Paste-ready code

100%

100%

Behavior-verification assertion

100%

100%

Without context: $0.4049 · 1m 59s · 26 turns · 29 in / 5,952 out tokens

With context: $0.5935 · 2m 28s · 33 turns · 72 in / 7,894 out tokens

100%

User Onboarding Service: Comprehensive Unit Test Coverage

Dependency analysis and multi-type double generation

Criteria
Without context
With context

All dependencies identified

100%

100%

Method names match source

100%

100%

Three doubles generated

100%

100%

Correct types selected

100%

100%

Framework consistent

100%

100%

Paste-ready code

100%

100%

Notification mock verified

100%

100%

Dependency analysis documented

100%

100%

Without context: $0.4876 · 2m 5s · 28 turns · 35 in / 6,583 out tokens

With context: $0.6701 · 2m 47s · 36 turns · 100 in / 8,762 out tokens

100%

Currency Converter Service: Unit Tests for External Rate Fetching

Python framework test doubles with unittest.mock

Criteria
Without context
With context

Python mock framework

100%

100%

HTTP dependency targeted

100%

100%

Mock type used

100%

100%

No real HTTP calls

100%

100%

Success path tested

100%

100%

Failure path tested

100%

100%

Behavior verification assertion

100%

100%

Paste-ready pytest code

100%

100%

Source names preserved

100%

100%

Without context: $0.2910 · 1m 11s · 18 turns · 23 in / 4,118 out tokens

With context: $0.5635 · 1m 52s · 31 turns · 37 in / 6,608 out tokens

100%

File Upload Service: Hardening Error Handling in Unit Tests

Stub configuration for error and rejection scenarios

Criteria
Without context
With context

All three dependencies identified

100%

100%

Rejection/throw configured

100%

100%

Validation failure path tested

100%

100%

Storage failure path tested

100%

100%

Registry failure path tested

100%

100%

Short-circuit verified

100%

100%

Jest framework used

100%

100%

Source names preserved

100%

100%

Happy path tested

100%

100%

Paste-ready code

100%

100%

Without context: $0.4560 · 2m 7s · 25 turns · 73 in / 7,101 out tokens

With context: $0.5546 · 2m 20s · 30 turns · 294 in / 7,723 out tokens

79%

1%

Task Queue Processor: Unit Tests for a Multi-Collaborator Worker

Dependency analysis for event-driven module with mixed double types

Criteria
Without context
With context

All four collaborators identified

100%

100%

EventBus spy used

0%

0%

Event emission verified

100%

100%

Stub used for data-returning deps

100%

100%

Failure path tested

100%

100%

Empty queue path tested

100%

100%

Happy path tested

100%

100%

Type rationale documented

41%

50%

Paste-ready Jest code

100%

100%

Source names preserved

100%

100%

Without context: $0.2244 · 1m 21s · 16 turns · 22 in / 3,468 out tokens

With context: $0.5520 · 2m 13s · 22 turns · 62 in / 6,407 out tokens

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.