test-naming-standards

Enforce .spec.ts test file naming and should-style test case names.

Updated Feb 4, 2025
One-click install
npx skills add https://github.com/DavidKk/vercel-web-scripts --skill test-naming-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-naming-standards
Source: https://github.com/DavidKk/vercel-web-scripts/tree/main/.cursor/skills/test-naming-standards
Command: npx skills add https://github.com/DavidKk/vercel-web-scripts --skill test-naming-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces consistent test naming across a codebase. Use when writing tests, creating test files, or when code review requires proper test naming.

Core Features & Use Cases

  • Enforce unit test file naming: use .spec.ts suffix for unit tests and for E2E tests.
  • Preserve directory structure mirroring source code to maintain traceability.
  • Standardize test case names using the should-style format with lowercase starts.

Quick Start

Apply these naming conventions to your test files and test cases to ensure consistency across the repository.

Frequently Asked Questions about test-naming-standards

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

FAQPage Schema
What is the standard naming convention for unit test files?

Unit test files should use the .spec.ts suffix to enforce consistent test naming across the codebase. E2E tests also use this suffix while preserving a directory structure that mirrors source code for strict traceability.

How should I structure test directories to mirror source code?

To structure test directories to mirror source code, you must preserve the exact directory structure of the implementation files. This maintains traceability between tests and source code during unit and e2e testing.

How do I name test cases using the should-style format?

To name test cases using the should-style format, begin the test name with lowercase letters and describe the expected behavior. Standardizing test case names this way ensures consistency during code review.

When do I need consistent test naming conventions in my codebase?

You need consistent test naming conventions when writing tests, creating test files, or performing a code review. Enforcing naming conventions ensures clarity and traceability across unit tests and e2e tests.

Does this test naming standard apply to both unit and e2e tests?

Yes, this test naming standard applies to both unit and e2e tests, requiring the .spec.ts suffix for test files. It standardizes test case names using the should-style format with lowercase starts.