vue-testing-best-practices

Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testi…

antfu ↓ 15k
Claude Code
View source ↗

What it does

  • 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

Requirements & configuration

  • Tests need to verify computed styles or real DOM events → See testing-browser-vs-node-runners

Derived from the skill's own SKILL.md documentation · extracted 2026-07-23

Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.

Source

Repository: https://github.com/antfu/skills

vue-testing-best-practices FAQ

What does the vue-testing-best-practices skill do?

Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E 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

What does vue-testing-best-practices require?

Tests need to verify computed styles or real DOM events → See testing-browser-vs-node-runners

How do I install vue-testing-best-practices?

Run: npx -y skills add https://github.com/antfu/skills --skill vue-testing-best-practices --agent claude-code — the source lives at github.com/antfu/skills.

Maintain vue-testing-best-practices?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

vue-testing-best-practices on getagentictools
[![vue-testing-best-practices on getagentictools](https://getagentictools.com/badge/skills/antfu-skills-vue-testing-best-practices.svg)](https://getagentictools.com/skills/antfu-skills-vue-testing-best-practices?ref=badge)
npx agentictools info skills/antfu-skills-vue-testing-best-practices

The second line is the CLI lookup for this page — handy in READMEs and docs.