testing

Enforce Vitest testing conventions with describe/it and jsdom environments.

Updated Jan 20, 2025
One-click install
npx skills add https://github.com/Nosto/web-components --skill testing-nosto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/Nosto/web-components/tree/main/.agents/skills/testing
Command: npx skills add https://github.com/Nosto/web-components --skill testing-nosto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardize testing conventions across the repository to reduce ambiguity and improve test quality.

Core Features & Use Cases

  • Establishes Vitest-based testing patterns including describe/it blocks and beforeEach/afterEach setup.
  • Guides test file structure and environment usage for jsdom to ensure consistent test execution.
  • Centralizes mock data and reference patterns to promote reuse and reliability across tests.

Quick Start

Run tests with vitest and follow the conventions when editing tests in the test/ directory.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I standardize Vitest testing conventions across my repository?

Standardize Vitest testing conventions by enforcing consistent describe/it patterns, beforeEach/afterEach setup, and jsdom environment usage across all test files. This reduces ambiguity and improves test quality by centralizing structured guidelines in SKILL.md.

What's the best way to structure TypeScript test files using describe and it blocks?

Structure TypeScript test files using standardized describe and it blocks with beforeEach and afterEach hooks for setup and teardown. This approach ensures consistent test execution patterns and promotes reliable mock data reuse across the test directory.

Does this testing approach work with jsdom environments for front-end tests?

Yes, this testing approach works with jsdom environments to ensure consistent front-end test execution. It guides test file structure and environment usage specifically for jsdom, standardizing how browser-like APIs are handled across the repository.

How do I centralize mock data and test patterns for Vitest?

Centralize mock data and test patterns for Vitest by following reference patterns documented in the repository. This promotes reuse and reliability across tests by ensuring all test files adhere to consistent mocking conventions and structured guidelines.

Can I apply these test conventions to CI workflows?

Yes, you can apply these test conventions to CI workflows. The standardized testing patterns extend to editing CI workflows, ensuring Vitest runs consistently in continuous integration environments with the same describe/it and jsdom conventions used locally.