mocking-assistant

Automate API and service mocking in tests with MSW and fixtures.

5|Updated Dec 31, 2025
One-click install
npx skills add https://github.com/patricio0312rev/skillset --skill mocking-assistant-patricio0312rev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mocking-assistant
Source: https://github.com/patricio0312rev/skillset/tree/main/templates/testing/mocking-assistant
Command: npx skills add https://github.com/patricio0312rev/skillset --skill mocking-assistant-patricio0312rev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MSW-based tooling to create deterministic API and service mocks for tests, reducing flakiness and setup time.

Core Features & Use Cases

  • MSW API mocking with realistic responses for frontend and backend tests.
  • Fixture conventions and test-specific mocks to enable predictable test data.
  • Service, module, and GraphQL mocking with isolated, overridable mocks for per-test scenarios.
  • Date/time and function mocking to simulate time-dependent behaviors.
  • Comprehensive usage patterns and best practices for robust test suites.

Quick Start

Install the skill and follow the prompts to configure MSW mocks, fixtures, and test-specific overrides.

Frequently Asked Questions about mocking-assistant

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up MSW mocks for deterministic API responses in tests?

MSW mocks for deterministic API responses are configured by following guided prompts to define handlers, fixtures, and test-specific overrides. This setup ensures predictable responses across unit and integration tests for both frontend and backend environments.

Can I mock GraphQL queries and mutations using MSW?

Yes, GraphQL mocking using MSW is fully supported to provide isolated, overridable mocks for per-test scenarios. This enables accurate simulation of GraphQL queries and mutations for frontend and backend code requiring deterministic responses.

What is the best way to manage test data fixtures for API mocking?

The best way to manage test data fixtures for API mocking is through standardized fixture conventions and test-specific overrides. This approach enables predictable test data setup while allowing individual tests to override default mocks without affecting the broader suite.

Does this mocking approach work with vitest for frontend and backend tests?

Yes, the mocking approach works with vitest to support both frontend and backend tests. It automates MSW setup, function spies, and service mocks to ensure deterministic responses across your entire test suite.

Why does my time-dependent test fail and how do I mock date and time?

Time-dependent tests fail due to uncontrolled temporal data, but date and time mocking simulates fixed temporal behaviors. This ensures deterministic test execution for time-sensitive application logic and performance scenarios.