Vitest

🌐Community
by teachingai · vlatest · Repository

Automates unit test generation and execution for TeachingAI models using Vitest, ensuring code quality and reliability.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add teachingai-vitest npx -- -y @trustedskills/teachingai-vitest
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "teachingai-vitest": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/teachingai-vitest"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill automates unit test generation and execution for TeachingAI models using Vitest, a testing utility for Vite projects. It provides access to Vitest's features and documentation, enabling agents to set up Vitest, write tests (including component and browser mode tests), configure environments, use APIs, and optimize performance. The skill is structured around the official Vitest documentation, providing guidance on various aspects of using Vitest effectively.

When to use it

  • Setting up Vitest in a Vite project for testing purposes.
  • Writing unit tests and component tests (Vue, React, or Svelte).
  • Configuring Vitest for different environments.
  • Utilizing Vitest's UI for test visualization.
  • Implementing visual regression testing to detect changes in the user interface.

Key capabilities

  • Vitest installation and setup within Vite projects.
  • Component testing (Vue, React, Svelte).
  • Browser mode testing.
  • Mocking functions and modules during tests.
  • Snapshot testing for verifying component output.
  • Code coverage analysis.
  • Access to Vitest API documentation.
  • Configuration of Vitest environments.

Example prompts

  • "Set up Vitest in my Vite project."
  • "Write a unit test for this Vue component."
  • "How do I configure Vitest for browser mode?"
  • "Show me an example of mocking functions with Vitest."

Tips & gotchas

  • This skill relies on the user having a Vite project already set up.
  • The agent will access and utilize files organized according to the official Vitest documentation structure, so familiarity with that structure is helpful for crafting prompts.
  • Refer to the Vitest API documentation (linked within the skill) for detailed information on available functions and configurations.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
teachingai
Installs
38

🌐 Community

Passed automated security scans.