testing

Writes and runs Vitest tests with behavior-focused coverage standards.

Updated Sep 17, 2025
One-click install
npx skills add https://github.com/Ultra-Cube/Ultra-AI --skill testing-ultra-cube
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/Ultra-Cube/Ultra-AI/tree/main/external-integrations/AionUi/.claude/skills/testing
Command: npx skills add https://github.com/Ultra-Cube/Ultra-AI --skill testing-ultra-cube

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested code from being shipped by enforcing a consistent testing workflow, quality rules, and coverage targets for every feature or bug fix. ## Core Features & Use Cases - Structured Test Workflow: Guides test writing from risk identification through execution and coverage verification using Vitest 4. - Quality Rules: Enforces behavior-focused test descriptions, failure-path coverage, and one-behavior-per-test discipline. - Dual Environments: Supports node and jsdom test environments with clear file naming conventions for unit, integration, regression, and e2e tests. - Use Case: When adding a new feature to an Electron app, use this Skill to write unit and integration tests, run the full suite, and confirm the 80% coverage target before committing. ## Quick Start Write tests for the new conversation caching feature and run the full test suite to verify coverage meets the target.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write good unit tests with Vitest?▼

Describe observable behavior rather than implementation details, keep one behavior per test, and include at least one failure path per describe block. Start from the riskiest scenarios such as undefined dependencies and boundary values.

How to run Vitest tests before committing code?▼

Run bun run test to execute the full suite, which is required before every commit. Use bun run test:coverage before opening a pull request to verify the 80 percent coverage target is met.

When should I use jsdom vs node environment in Vitest?▼

Use the default node environment for main process code, utilities, and services with *.test.ts files. Use jsdom for DOM or browser-dependent code, naming those files *.dom.test.ts.

Why do my tests pass but not actually guard the code?▼

Tests that only mirror implementation or lack assertions on real behavior can pass even when logic is deleted. Mentally remove the core logic the test targets; if it still passes, rewrite the test to assert observable outcomes.

What edge cases should unit tests cover?▼

Cover null and undefined inputs, empty arrays and objects, errors thrown by dependencies, boundary values like zero and maximums, and async behaviors including timeouts, rejections, and cancellation.