write-tests

Generate unit and integration tests with Vitest and Svelte testing libraries.

3|1|Updated May 15, 2025
One-click install
npx skills add https://github.com/xergioalex/xergioalex.com --skill write-tests-xergioalex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-tests
Source: https://github.com/xergioalex/xergioalex.com/tree/main/.claude/skills/write-tests
Command: npx skills add https://github.com/xergioalex/xergioalex.com --skill write-tests-xergioalex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the need to ensure code reliability and maintainability by adding or expanding automated tests for existing codebases.

Core Features & Use Cases

  • Test Generation: Creates new unit or integration tests for specified code modules.
  • Test Expansion: Adds comprehensive test cases, including edge cases and mocks, to existing test files.
  • Use Case: You've just implemented a new utility function in src/lib/utils.ts. Use this Skill to automatically generate a src/lib/utils.test.ts file with tests covering its core functionality and potential failure scenarios.

Quick Start

Use the write-tests skill to add unit tests for the src/components/UserProfile.svelte component.

Frequently Asked Questions about write-tests

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

FAQPage Schema
How do I add unit tests for existing code using Vitest?

To add unit tests using Vitest, this Skill generates or expands test files for specified modules, covering happy paths, edge cases, and necessary mocks to ensure code reliability and maintainability.

How do I write integration tests for Svelte components?

Writing integration tests for Svelte components is handled by automatically generating test cases using Vitest and Svelte testing libraries, ensuring specified modules behave reliably across different scenarios.

Can I expand existing test files with edge cases and mocks?

Yes, you can expand existing test files. The Skill adds comprehensive test cases, including edge cases and mocks, to existing code to enhance overall code quality and maintainability.

Does this testing approach work for utility functions and Svelte modules?

Yes, this testing approach works for both. It creates new unit or integration tests for specified Svelte components and utility functions, covering core functionality and potential failure scenarios.

What is the best way to ensure code reliability when adding automated tests?

The best way to ensure code reliability is by adding or expanding automated tests within a configured testing framework. This covers core functionality, failure scenarios, and necessary mocks.

When do I need to generate mocks for my Vitest test cases?

You need to generate mocks for Vitest test cases when expanding tests for existing code. The Skill automatically includes necessary mocks to properly isolate modules and validate edge cases.