home / skills / jeremylongshore / claude-code-plugins-plus-skills / vitest-test-creator

This skill helps you create and configure production-ready vitest tests, patterns, and mocks with automated guidance for test automation.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill vitest-test-creator

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.1 KB
---
name: "vitest-test-creator"
description: |
  Create vitest test creator operations. Auto-activating skill for Test Automation.
  Triggers on: vitest test creator, vitest test creator
  Part of the Test Automation skill category. Use when writing or running tests. Trigger with phrases like "vitest test creator", "vitest creator", "vitest".
allowed-tools: "Read, Write, Edit, Bash(cmd:*), Grep"
version: 1.0.0
license: MIT
author: "Jeremy Longshore <[email protected]>"
---

# Vitest Test Creator

## Overview

This skill provides automated assistance for vitest test creator tasks within the Test Automation domain.

## When to Use

This skill activates automatically when you:
- Mention "vitest test creator" in your request
- Ask about vitest test creator patterns or best practices
- Need help with test automation skills covering unit testing, integration testing, mocking, and test framework configuration.

## Instructions

1. Provides step-by-step guidance for vitest test creator
2. Follows industry best practices and patterns
3. Generates production-ready code and configurations
4. Validates outputs against common standards

## Examples

**Example: Basic Usage**
Request: "Help me with vitest test creator"
Result: Provides step-by-step guidance and generates appropriate configurations


## Prerequisites

- Relevant development environment configured
- Access to necessary tools and services
- Basic understanding of test automation concepts


## Output

- Generated configurations and code
- Best practice recommendations
- Validation results


## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Configuration invalid | Missing required fields | Check documentation for required parameters |
| Tool not found | Dependency not installed | Install required tools per prerequisites |
| Permission denied | Insufficient access | Verify credentials and permissions |


## Resources

- Official documentation for related tools
- Best practices guides
- Community examples and tutorials

## Related Skills

Part of the **Test Automation** skill category.
Tags: testing, jest, pytest, mocking, tdd

Overview

This skill automates creation of Vitest test files, configurations, and test patterns to speed test automation workflows. It generates production-ready unit and integration test code, recommends structure and mocks, and validates outputs against common standards. Use it to standardize Vitest usage across projects and reduce manual test boilerplate.

How this skill works

When triggered, the skill inspects your request context (file paths, frameworks, and target modules) and generates Vitest test suites, setup files, and configuration snippets. It follows industry patterns for test isolation, mocking, and fixture management, and can produce runnable examples and CI-ready configuration. The skill also validates that generated code uses recommended practices and correct imports.

When to use it

  • You need new Vitest unit or integration tests quickly for JS/TS modules
  • You want consistent test patterns, setup, and teardown across a codebase
  • You need example mocks, spies, or stubs for external dependencies
  • You are configuring Vitest in a new project or CI pipeline
  • You want to convert existing test ideas into runnable Vitest files

Best practices

  • Keep tests focused: one behavior or assertion per test
  • Use beforeEach/afterEach for shared setup and teardown
  • Prefer dependency injection or mocking for external services
  • Use descriptive test names and maintain small, fast test suites
  • Add type-aware tests for TypeScript to catch typing regressions

Example use cases

  • Generate unit tests for a utility module with edge-case coverage
  • Create integration tests that set up in-memory databases or fixtures
  • Produce mock implementations and spy verifications for HTTP clients
  • Create Vitest config and setup files for a monorepo or CI pipeline
  • Convert Jest-style tests to Vitest-compatible suites

FAQ

Can the skill generate TypeScript tests?

Yes. It can produce TS test files with correct types, imports, and tsconfig-aware patterns.

Will it run tests or only generate files?

Primary function is generation and validation of test code and config; you can run tests locally or in CI after generation.

How does it handle external dependencies in tests?

It recommends and generates mocks, stubs, or dependency injection patterns and points out required devDependencies.