api-testing

Write unit tests for API services using Bun's test framework.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/charlie83Gs/communities --skill api-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-testing
Source: https://github.com/charlie83Gs/communities/tree/main/.claude/skills/api-testing
Command: npx skills add https://github.com/charlie83Gs/communities --skill api-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bun:test.

What problem does it solve?

Writing comprehensive and maintainable tests for API services and repositories can be challenging, leading to untested code and undetected bugs. This skill provides patterns to build a robust testing suite.

Core Features & Use Cases

  • Bun Test Framework: Utilize Bun's built-in test runner for fast and efficient unit and integration testing, accelerating feedback cycles.
  • Mocking Dependencies: Isolate and test service logic by effectively mocking repository and external service dependencies, ensuring focused unit tests.
  • Test Data Management: Create reusable test data and helpers to streamline test setup and ensure consistency across your test suite.
  • Error Scenario Testing: Thoroughly test how your API handles various error conditions, from resource not found to unauthorized access, improving application resilience.
  • Use Case: Write unit tests for a new CommunityService method. You'll mock its dependent repositories, provide test data, and verify both successful execution and error handling (e.g., when a user lacks permission), ensuring the new feature is reliable.

Quick Start

Write a unit test for the createCommunity service method, mocking the communityRepository and appUserRepository to verify successful community creation and admin assignment.