test-controller
CommunityEffortless controller testing with mocks
Authormadooei
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Tests controllers by isolating them from actual services by mocking dependencies and Hono context, enabling reliable unit tests.
Core Features & Use Cases
- Mock services and context to exercise controller methods (getAll, getById, create, update, delete) in isolation.
- Verify responses, error handling, and interaction with services without hitting real data stores.
- Use Case: Write a unit test for a controller's getById path to ensure it returns a 404 when NotFoundError is thrown from the service.
Quick Start
Write unit tests for a controller by mocking its services and the Hono context to cover typical success and error paths.
Dependency Matrix
Required Modules
None requiredComponents
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: test-controller Download link: https://github.com/madooei/backend-template/archive/main.zip#test-controller Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.