Repository inventory

protagonistss/ithinku-plugins

Skills indexed from this repository, with install-style signals scoped to the repo.
5 skills0 GitHub stars0 weekly installsTypeScriptGitHubOwner profile

Overview

This skill generates mock data and stub functions for tests to isolate external dependencies and speed up development. It creates typed mock objects, realistic datasets, API responses, database stubs, and time/random controls. The skill supports Jest and Vitest templates and offers configurable generation options for edge cases and error scenarios. It is focused on TypeScript projects and produces reusable, test-friendly mocks.

How this skill works

The skill analyzes module exports, function signatures, return types, and common external interactions (DB, HTTP, timers, randomness) to determine what to mock. It generates typed mock objects, factory-based data generators, API response shapes, and stub implementations with sync/async behaviors. Templates for Jest, Vitest, and Python show how to wire mocks into test suites, and utilities provide boundary, invalid, and paginated responses. Call-history, custom return values, and error simulation are supported for detailed behavior control.

When to use it

  • When tests rely on external APIs, databases, or system time and need isolation.
  • When generating realistic but deterministic datasets for unit or integration tests.
  • When you need reusable factories for complex nested objects or lists.
  • When testing error handling: network, timeout, validation, or database edge cases.
  • When you want consistent mock templates for Jest, Vitest, or cross-language examples.

Best practices

  • Only mock external dependencies; keep business logic unmocked to avoid false confidence.
  • Use factory/generator patterns to produce reusable, consistent test data.
  • Include boundary and invalid-data generators to validate error paths.
  • Reset or clear mocks between tests (beforeEach/afterEach) to avoid cross-test leakage.
  • Prefer partial mocks over full module replacements when you want to preserve real behavior selectively.

Example use cases

  • Auto-generate mocks for a user service module with typed return values and spies for Vitest.
  • Create stubbed database methods (findById, create, update) that return realistic user fixtures, including not-found cases.
  • Mock fetch/XHR to return paginated API responses, success, and error scenarios for frontend tests.
  • Produce time-controlled tests using fake timers for delayed callbacks and scheduled jobs.
  • Generate sequences of async stub behaviors to test retry and promise-chain logic.

FAQ

Yes. It supports async stubs, mockResolvedValue/mockRejectedValue sequences and configurable multi-call behaviors.

How do I control generated values or provide custom returns?

You can pass customReturnValues per export or provide override objects to generators to shape returned fixtures.

5 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational