thedaviddias/front-end-checklist

mock-best-practices

Use when reviewing CI coverage, automated checks, or test strategy related to Follow mocking best practices. Focus on whether the rule is continuously verified, not just documented.

First seen Aug 7, 2026

Installation

$ npx skills add thedaviddias/front-end-checklist --skill mock-best-practices

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from thedaviddias/front-end-checklist · top by installs.

npx skills add thedaviddias/front-end-checklist

Browse all from thedaviddias/front-end-checklist

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 74.1K
License MIT
Default branch main
Open issues 5
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
category
testing
priority
medium
difficulty
intermediate
estimatedTime
20
source
frontendchecklist.io
url
https://frontendchecklist.io/en/rules/testing/mock-best-practices

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,707 B
  • docs SUMMARY.md 208 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 6 installs

SKILL.md

Follow mocking best practices

Proper mocking isolates units under test while keeping tests realistic—over-mocking creates false confidence when tests pass but production breaks.

Quick Reference

  • Mock external dependencies (APIs, databases, file system), not business logic
  • Always clean up mocks with jest.restoreAllMocks() in afterEach
  • Use MSW for realistic API mocking without coupling to implementation
  • Test behavior and outputs, not internal implementation details

Check

Review this test file for mocking patterns, checking for over-mocking, missing mock cleanup, and proper mock implementation.

Fix

Improve mocking strategy by removing unnecessary mocks, adding proper cleanup, and mocking at the right level of abstraction.

Explain

Explain mocking best practices including when to mock, what to mock, and common mocking pitfalls.

Code Review

Review tests, CI workflows, and enforcement points related to Follow mocking best practices. Flag exact gaps where the rule is not automatically verified or where failures do not block regressions.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/en/rules/testing/mock-best-practices