vue-testing-best-practices

Provides Vue 3 testing guidance for component, E2E workflows using Vitest and Playwright.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/1zumIQ/asched_frontend --skill vue-testing-best-practices-1zumiq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-testing-best-practices
Source: https://github.com/1zumIQ/asched_frontend/tree/main/.agents/skills/vue-testing-best-practices
Command: npx skills add https://github.com/1zumIQ/asched_frontend --skill vue-testing-best-practices-1zumiq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides structured guidance for testing Vue 3 applications, consolidating best practices for unit, component, composable, and end-to-end testing with Vitest, Vue Test Utils, Pinia, and Playwright.

Core Features & Use Cases

  • Test strategy: Blackbox testing approaches, avoiding reliance on internal state.
  • Tooling patterns: Vitest, Vue Test Utils, @pinia/testing, and Playwright for E2E.
  • Gotchas & anti-patterns: Common pitfalls and concrete fixes with examples.
  • Reference library: Curated docs and references for deeper learning.
  • Use Case: Teams migrating from Jest or older setups can adopt a cohesive Vue testing workflow across unit, component, and E2E tests.

Quick Start

Read through the references and implement a small test suite for a sample component using Vitest and Vue Test Utils.

Frequently Asked Questions about vue-testing-best-practices

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

FAQPage Schema
How do I test Vue 3 components using Vitest and Vue Test Utils?

To test Vue 3 components, use Vitest as the test runner and Vue Test Utils to mount components. This Skill provides structured workflows for blackbox testing approaches, helping you avoid relying on internal state while validating component behavior and outputs.

What is the best way to test Pinia stores in a Vue application?

Testing Pinia stores in a Vue application is best handled using the @pinia/testing package. This Skill outlines specific tooling patterns to isolate and test state management logic cleanly without leaking state across test cases.

Does this Vue testing guidance cover end-to-end testing with Playwright?

Yes, this Vue testing guidance covers end-to-end testing with Playwright. It provides comprehensive strategies for setting up E2E tests alongside unit and component tests to ensure full application coverage across common patterns.

How do I migrate my Vue testing setup from Jest to Vitest?

Migrating from Jest to Vitest involves adopting a cohesive Vue testing workflow. This Skill consolidates best practices and curated references to guide your setup, strategy, and tooling decisions for a smooth transition to Vitest.

What are common anti-patterns when testing Vue composables?

Common anti-patterns when testing Vue composables include relying on internal state rather than blackbox outputs. This Skill details specific gotchas and provides concrete fixes with examples to improve your testing strategy.