testing

Codify Vitest testing conventions for Esposter test structure and assertions.

23|3|Updated Jun 28, 2022
One-click install
npx skills add https://github.com/Esposter/Esposter --skill testing-esposter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/Esposter/Esposter/tree/main/.agents/skills/testing
Command: npx skills add https://github.com/Esposter/Esposter --skill testing-esposter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes Vitest testing practices across the codebase to improve reliability, readability, and maintainability of tests.

Core Features & Use Cases

  • Structure: Enforces using test(...) and descriptive describe blocks with function references, and keeps shared constants inside the describe callback.
  • Consistency: Encourages inline creation of caller factories and strict naming conventions for test helpers to avoid ambiguity.
  • Reliability: Requires explicit assertions, deterministic values, and DRY principles to reduce flaky tests and duplication.
  • Use Case: Onboarding new contributors, reducing test review time, and ensuring uniform test quality across projects.

Quick Start

Follow the Vitest conventions described above when writing new tests in Esposter projects.

Frequently Asked Questions about testing

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

FAQPage Schema
What are the best Vitest testing conventions for structuring describe blocks and test cases?

Vitest testing conventions standardize test organization by prescribing descriptive describe blocks with function references and keeping shared constants inside the describe callback. This structure improves readability and maintainability across projects.

How do I reduce flakiness in JavaScript and TypeScript tests using explicit assertions?

To reduce flakiness in JavaScript and TypeScript tests, enforce explicit assertions, deterministic values, and DRY principles. Standardizing these assertion practices minimizes unpredictable failures and ensures reliable execution.

Why should I use inline caller factories and strict naming conventions for test helpers?

Inline caller factories and strict naming conventions for test helpers prevent ambiguity and duplication in your test suite. Applying these DRY testing practices ensures shared utilities remain clear, reusable, and easy to understand during onboarding.

Does this Skill require specific dependencies or environments to enforce Vitest conventions?

This Skill requires no external dependencies or components to enforce Vitest testing conventions. It provides actionable guidelines for test organization and assertions that integrate directly into your existing JavaScript and TypeScript codebase.

When should I standardize test structure to improve onboarding for new contributors?

You should standardize test structure to improve onboarding whenever new contributors struggle with inconsistent test quality or prolonged test review times. Codifying Vitest conventions ensures uniform practices, reducing ambiguity and accelerating the onboarding process.