test-naming-and-fixture-clarity

Aligns test titles with fixture conditions in Bats, Jest, and Playwright suites.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill test-naming-and-fixture-clarity-vilnacrm-org
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-naming-and-fixture-clarity
Source: https://github.com/VilnaCRM-Org/claude-plugins/tree/main/plugins/react-frontend-sdlc/skills/test-naming-and-fixture-clarity
Command: npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill test-naming-and-fixture-clarity-vilnacrm-org

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test titles that describe the fixture setup instead of the failing condition mislead maintainers into trimming fixtures that look bloated, silently widening guards while tests still pass. This Skill keeps test names, fixture intent comments, and assertions aligned with the actual guard under test. ## Core Features & Use Cases - Condition-based naming: Rewrites test titles to state the rejected condition rather than the fixture state, so the fixture reads as required rather than padded. - Fixture intent comments: Adds in-test comments explaining which earlier guards each retained fixture part clears, preventing accidental removal during cleanup. - Guard-specific assertions: Pins each test to a message fragment unique to its guard instead of reusing one broad failure assertion. - Use Case: A Bats gate test titled "empty static dir" actually keeps a populated directory and removes only .js files to reach the no-JS guard; this Skill retitles it to the failing condition and documents why the populated fixture must stay. ## Quick Start Review this Bats gate test and rename it so the title states the failing condition while adding a comment explaining what the retained fixture parts clear.

Frequently Asked Questions about test-naming-and-fixture-clarity

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

FAQPage Schema
How do I name a test whose fixture looks oversized?▼

Name the test after the condition the validator rejects, not the fixture state. A title like "fails when the static dir has no .js files" makes a populated fixture read as required setup rather than bloat.

How to write Bats gate tests that target one specific guard?▼

Build the fixture to satisfy all earlier guards, then break only the condition under test. Assert on a message fragment unique to that guard so an earlier guard cannot satisfy the test.

Does this apply to Jest and Playwright tests or only Bats?▼

It applies to Bats gate tests, Jest specs, and Playwright specs across React SPA, Next.js, and component-library repository shapes. The naming and fixture-intent principles are framework-independent.

Why do guard tests pass even after the fixture is trimmed?▼

Trimming a fixture can make an earlier guard fire instead of the intended one, and a generic failure assertion still passes. Pin each test to a message fragment unique to its guard to detect this.

When should I not use this test naming approach?▼

Do not use it for choosing which test suite to run or triaging flaky failures. It targets naming, fixture intent, and assertion specificity in gate and unit tests, not suite selection or flake diagnosis.