V
vue-testing-best-practices
About vue-testing-best-practices
A Vue.js skill with testing practices, patterns, and common pitfalls. It guides Vue developers on test setup, component and composable tests, asynchronous behavior, and end-to-end testing.
Key features
- 01Vue 3 test setup guidance
- 02Component and composable testing patterns
- 03Async test and race-condition handling
- 04Browser and Node runner selection
- 05E2E framework recommendations
Use cases
- 01Choosing a test setup for Vue 3
- 02Testing composables that use lifecycle hooks
- 03Diagnosing asynchronous test flakiness
- 04Testing DOM events and computed styles
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ liangmiqwq/ skills --skill vue-testing-best-practicesAfter installing, type/vue-testing-best-practicesin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
reference/async-component-testing.mdteleport-testing-complexity.mdtesting-async-await-flushpromises.mdtesting-browser-vs-node-runners.mdtesting-component-blackbox-approach.mdtesting-composables-helper-wrapper.mdtesting-e2e-playwright-recommended.mdtesting-no-snapshot-only.mdtesting-pinia-store-setup.mdtesting-suspense-async-components.mdtesting-vitest-recommended-for-vue.mdDetails
From the project READMEVue.js testing best practices, patterns, and common gotchas.
Testing
- Setting up test infrastructure for Vue 3 projects → See testing-vitest-recommended-for-vue
- Tests keep breaking when refactoring component internals → See testing-component-blackbox-approach
- Tests fail intermittently with race conditions → See testing-async-await-flushpromises
- Composables using lifecycle hooks or inject fail to test → See testing-composables-helper-wrapper
- Getting "injection Symbol(pinia) not found" errors in tests → See testing-pinia-store-setup
- Components with async setup won't render in tests → See testing-suspense-async-components
- Snapshot tests keep passing despite broken functionality → See testing-no-snapshot-only
- Choosing end-to-end testing framework for Vue apps → See testing-e2e-playwright-recommended
- Tests need to verify computed styles or real DOM events → See testing-browser-vs-node-runners
- Testing components created with defineAsyncComponent fails → See async-component-testing
- Teleported modal content can't be found in wrapper queries → See teleport-testing-complexity
Reference
Comments
Markdown supported