spread-real-module-exports-as-base-of-every-mock-module-return-o

Official

Ensure mocks use real module exports by default.

AuthorZaxbyHub
Version1.0.0
Installs0

System Documentation

What problem does it solve?

When using Node.js's built-in mock.module functionality, default mock return objects do not include the real module's exports, leading to missing properties, incorrect mock behavior, and test failures that do not reflect actual module behavior.

Core Features & Use Cases

  • Enforces spreading real module exports as the base of every mock.module return object to align mock behavior with actual module interfaces.
  • Includes automated reviewer checks to grep for mock.module patterns that lack the required real module spread, catching inconsistent mocks early in the development workflow.
  • Use Case: When writing unit tests for a Node.js utility module, apply this skill to ensure all mock.module return objects include the utility's real exports, avoiding test failures from missing mock properties.

Quick Start

Apply this skill when writing Node.js unit tests to ensure all mock.module return objects spread the real module's exports as their base.

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: spread-real-module-exports-as-base-of-every-mock-module-return-o
Download link: https://github.com/ZaxbyHub/opencode-swarm/archive/main.zip#spread-real-module-exports-as-base-of-every-mock-module-return-o

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 537,000+ vetted skills library on demand.