generate-tests

Generate vitest test cases from spec Test Scenarios headings.

43|1|Updated Feb 19, 2024
One-click install
npx skills add https://github.com/dogganidhal/noddde --skill generate-tests-dogganidhal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-tests
Source: https://github.com/dogganidhal/noddde/tree/main/.claude/skills/generate-tests
Command: npx skills add https://github.com/dogganidhal/noddde --skill generate-tests-dogganidhal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating vitest tests from specs is time-consuming and error-prone. This skill automates the generation of test scaffolds directly from a spec's Test Scenarios, ensuring every scenario has a corresponding test outline before implementation.

Core Features & Use Cases

  • Spec-driven test generation: Converts each Test Scenario heading into a separate test case.
  • RED-phase enforcement: Generates tests prior to code to verify that missing behavior will be caught.
  • Integrates with existing specs: Reads frontmatter, uses the 'exports' field for imports, and places tests in the appropriate tests path.

Quick Start

Run this skill against a spec to generate its vitest tests.

Frequently Asked Questions about generate-tests

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

FAQPage Schema
How do I generate vitest tests automatically from spec files?

To generate vitest tests from specs, you target the spec file and the skill translates each Test Scenario heading into a separate test case, storing the results in the matching __tests__ directories.

What is RED-phase enforcement in spec-driven test generation?

RED-phase enforcement generates tests prior to writing implementation code. This verifies that missing behavior is caught early, ensuring every scenario has a failing test outline before development begins.

How do I ensure correct imports when generating vitest tests from specs?

To ensure correct imports during vitest test generation, the skill reads and respects the frontmatter exports field in your spec files. This guarantees the generated test scaffolds use the correct module imports.

Does vitest test generation work with specs in integration and core areas?

Yes, vitest test generation specifically targets specs under the core and integration areas. It automatically places the resulting test files in the appropriate __tests__ paths corresponding to those spec locations.

Can I scaffold one test case per test scenario heading in vitest?

Yes, you can scaffold one test case per scenario heading. The skill converts each Test Scenario heading found in a spec into a separate vitest test case, creating a complete test outline for the file.

What happens if a spec is not ready for automated test generation?

If a spec is not ready, the skill validates spec readiness before proceeding. This prevents generating flawed test scaffolds by ensuring the spec meets the required structure and content criteria.