vue-testing-best-practices

Guide Vue.js component testing for Teleport and async behaviors.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/richardaum/sporty-group --skill vue-testing-best-practices-richardaum
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-testing-best-practices
Source: https://github.com/richardaum/sporty-group/tree/main/.agents/skills/vue-testing-best-practices
Command: npx skills add https://github.com/richardaum/sporty-group --skill vue-testing-best-practices-richardaum

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of testing Vue.js applications effectively, ensuring reliable and maintainable test suites that closely mimic real user interactions.

Core Features & Use Cases

  • Guidance for Writing Robust Tests: Provides best practices for testing Vue components, composables, and asynchronous behaviors.
  • Handling Teleport and Async Components: Explains how to test complex Vue features like Teleport and <Suspense>.
  • Use Case: A developer wants to verify that a Vue modal correctly teleports outside the DOM structure; this Skill guides proper stub and query approaches.

Quick Start

Use the vue-testing-best-practices skill to understand how to test Vue components that use Teleport or async setup properly.

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 components that use Teleport?

Testing Vue Teleport components requires using proper stubs and query approaches to verify content renders outside the original DOM structure, ensuring tests remain maintainable and avoid relying on implementation details.

What is the best way to test async setup in Vue components?

Testing async setup in Vue components involves simulating realistic user interactions to verify asynchronous behaviors without relying on internal implementation details, ensuring reliable and maintainable test suites for complex component interactions.

Why does my Vue component test fail when using Suspense?

Vue component tests using Suspense often fail when relying on implementation details rather than realistic user simulation; testing complex asynchronous behaviors requires detailed strategies to handle loading states and fallback content properly.

Can I test Vue composables without mounting full components?

Testing Vue composables without mounting full components is possible by focusing on the composable's input and output behavior, following best practices for writing robust tests for composables and async behaviors while maintaining reliability.

When do I need to stub Vue components in integration tests?

Stubbing Vue components in integration tests is necessary when dealing with complex component interactions like Teleport or async setup, helping verify realistic user simulation while avoiding fragile tests that depend on implementation details.