vitest-author

Encode Vitest testing patterns for PANERCEa services with interleaved data and explicit imports.

Updated Nov 16, 2025
One-click install
npx skills add https://github.com/aaronjullger-lgtm/PANaCEa --skill vitest-author
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest-author
Source: https://github.com/aaronjullger-lgtm/PANaCEa/tree/main/.claude/skills/vitest-author
Command: npx skills add https://github.com/aaronjullger-lgtm/PANaCEa --skill vitest-author

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write high-quality Vitest tests for PANaCEa services, following project conventions. Use this skill whenever writing tests, fixing failing tests, adding test coverage, or the user says "test this", "add tests", "why is this test failing", or "run tests". Also use when implementing any new service — every service needs tests. This skill prevents common test pitfalls like ordering artifacts in test data, incorrect signal strength math assertions, and missing vitest imports.

Core Features & Use Cases

  • Codifies the interleaved helper pattern to avoid ordering artifacts in test data
  • Provides guidance for Vitest configuration, test structure, and explicit imports
  • Covers common testing pitfalls (z-score math notes, pure vs DB testing, and running tests)

Quick Start

Create a new Vitest test file under tests/ following the documented patterns, then run npx vitest run tests/ to verify coverage.

Frequently Asked Questions about vitest-author

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

FAQPage Schema
How do I write reliable Vitest unit tests for TypeScript services?

Structure Vitest tests by placing files under a tests/ directory using explicit imports, separating pure logic from database function testing, and applying interleaved data patterns to prevent test ordering artifacts.

Why does my Vitest test data have ordering artifacts and failing assertions?

Vitest test data ordering artifacts occur when sequential data setup introduces dependencies. Use the interleaved helper pattern to randomize or separate data, and double-check z-score math assertions to prevent calculation failures.

What's the best way to configure Vitest for testing JavaScript and TypeScript services?

The best way to configure Vitest for JavaScript and TypeScript services is to follow project conventions by ensuring explicit imports, structuring test files properly, and running coverage checks with npx vitest run tests/.

Can I use Vitest to test pure functions separately from database functions?

Yes, you can use Vitest to test pure functions separately from database functions by structuring test files to isolate logic, ensuring explicit imports are present, and validating test coverage across service components.

Do I need explicit vitest imports to run unit tests with npx vitest?

Yes, you need explicit vitest imports like describe, it, and expect to run unit tests successfully. Missing these imports is a common pitfall that causes test failures when validating service coverage with npx vitest run tests/.