test-authoring-edho-ferdian

Guides writing unit and component tests for React, Python, Go, and Vue.

2|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/edhoferdian/EEF --skill test-authoring-edho-ferdian-edhoferdian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-authoring-edho-ferdian
Source: https://github.com/edhoferdian/EEF/tree/main/.agents/skills/test-authoring-edho-ferdian
Command: npx skills add https://github.com/edhoferdian/EEF --skill test-authoring-edho-ferdian-edhoferdian

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing good unit and component tests is a craft most developers learn by trial and error: choosing the wrong queries, mocking at the wrong layer, sharing mutable state across tests, and asserting implementation details instead of behavior. This Skill provides concrete authoring guidance at the moment a test is being written, across four major stacks, so tests are behavior-focused, non-flaky, and maintainable from the start. ## Core Features & Use Cases - Stack-specific authoring guides: React/Testing Library (query priority, userEvent, MSW network mocking, renderHook, jest-axe), Python/pytest (fixtures, parametrize, patch-site rules, AsyncMock), Go (table-driven tests, subtests, interface mocking, benchmarks), and Vue (mount strategies, composables, Pinia, nextTick handling). - Baseline testing standards: the 80% coverage floor and its qualifications, RED-GREEN-REFACTOR loop, Arrange-Act-Assert structure, behavior-describing naming, and a diagnose-in-order protocol for failing tests. - Regression test patterns: four recurring bug patterns (dual-path shape drift, projection omission, error-state leakage, missing rollback) and how to write the test a found bug earned. - Use Case: During a TDD workflow, you ask how to test a custom React hook that fetches data — the Skill walks you through renderHook with a fresh QueryClient per test, MSW handlers, and waitFor assertions, avoiding the shared-instance flake trap. ## Quick Start Ask the assistant to help you write a unit test for a specific component, hook, function, or store in React, Python, Go, or Vue, describing the behavior you want to verify.

Frequently Asked Questions about test-authoring-edho-ferdian

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

FAQPage Schema
How do I write a good React component test with Testing Library?

Render the component with its production providers, interact via accessible queries like getByRole and userEvent, and assert visible output or observable side effects. Avoid container.querySelector, render-count assertions, and mocking child components by default.

How do I mock network requests in component tests?

Use Mock Service Worker (MSW) to intercept at the network layer so the real fetch client runs unmodified. Set onUnhandledRequest to "error" so any unmocked request fails the test loudly instead of silently hitting the real network.

Where should I patch when mocking in pytest?

Patch where the name is looked up, not where it is defined. If the module under test does "from client import api_call", patch "mypackage.service.api_call", not the original definition site, or the mock will silently never be called.

Why are my tests flaky when sharing a QueryClient or store?

Shared instances created at module scope carry cached state between tests, making results depend on execution order. Create a fresh QueryClient, Pinia instance, or equivalent inside each test before defining the wrapper.

What is the difference between this and reviewing existing tests?

This Skill teaches how to write a test before it exists: query choice, mocking, async handling, and structure. Judging whether an already-written test is good belongs to a separate test-quality review lens with tool-backed evidence.

When should I use table-driven tests in Go?

Use table-driven tests for any function with more than one meaningful input case, including error rows in the same table. On Go versions before 1.22, shadow the loop variable with tt := tt inside parallel subtests to avoid the capture trap.