vue-composable-testing
CommunityTest Vue 3 composables with Vitest.
System Documentation
What problem does it solve?
The Vue composable testing skill provides practical guidance and utilities to verify Vue 3 composables with Vitest, enabling reliable unit tests for reactive logic, lifecycle behavior, and dependency injection.
Core Features & Use Cases
- Independent composables: test pure logic using Vue's reactivity APIs (ref, computed, watch) without needing a full component.
- Dependent composables: test composables that rely on lifecycle hooks or dependency injection using setup helpers like withSetup and useInjectedSetup.
- Context-aware testing: simulate router or DI contexts with helper utilities (withRouter, withContext, useInjectedSetup) to cover real-world usage.
- Best practices: demonstrates patterns for async tests, error handling, and cleanup to ensure robust tests.
Quick Start
Create tests alongside your composables and import the provided helpers to mount and exercise the composables in isolation. For example, test a simple independent composable with withSetup to verify reactive behavior, or test an injectable composable with useInjectedSetup by providing a mock context.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: vue-composable-testing Download link: https://github.com/alexanderop/workoutTracker/archive/main.zip#vue-composable-testing Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.