V
vue-testing-best-practices
About vue-testing-best-practices
A Vue.js testing practice skill for developers working on Vue projects. It groups advice on test setup, component and composable tests, async behavior, and browser versus Node test runners, including common failure modes.
Key features
- 01Vue test infrastructure guidance
- 02Component black-box testing patterns
- 03Async and lifecycle testing advice
- 04Pinia and Suspense test setup
- 05Browser and Node runner considerations
Use cases
- 01Choosing a testing setup for Vue 3
- 02Investigating flaky asynchronous tests
- 03Testing composables that use lifecycle hooks
- 04Testing teleported or async components
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ vuejs-ai/ 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