advanced-js-mocking-patterns

Official

Master advanced mocking for reliable tests.

AuthorAgentient
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Advanced mocking patterns reduce flaky tests by isolating units from dependencies, enabling deterministic behavior across code paths.

Core Features & Use Cases

  • Module mocking of dependencies with jest.mock/vi.mock
  • Partial mocking with spies to verify interactions without full replacements
  • Mock lifecycle management with setup/teardown hooks
  • Fake timers to test time-dependent logic
  • Custom mock implementations for complex behavior
  • Use Case: test a network request flow without real network calls, ensuring correct handling of success and failure paths.

Quick Start

Run a test suite that demonstrates module mocking, spies, and fake timers.

Dependency Matrix

Required Modules

None required

Components

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: advanced-js-mocking-patterns
Download link: https://github.com/Agentient/vibekit/archive/main.zip#advanced-js-mocking-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.