From mk
Reviews Vue 3 testing patterns with Vitest and Vue Test Utils for components, composables, Pinia stores, Vue Router, async/Suspense, Teleport, forms, accessibility, and Playwright E2E strategy. Advisory only.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mk:vue-testing-best-practicesWhen to use
Use when the subject IS Vue 3 test-code quality — designing/auditing Vue tests or choosing Vue test tooling. NOT for: running tests/TDD/non-Vue/generic Playwright runner practices (mk:testing), diff/PR review or test-existence gaps (mk:review), coverage maps (mk:nyquist), QA + bug-fixing a running app (mk:qa), E2E spec generation/run (mk:qa-manual), browser driving (mk:agent-browser/mk:playwright-cli), or Vue feature code (mk:vue/mk:vue-best-practices).
This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Vue-specific **test-design advisor + test-code reviewer**. Recommends how to test Vue 3
SYNC.mdreference/accessibility-testing.mdreference/async-component-testing.mdreference/form-testing.mdreference/teleport-testing-complexity.mdreference/test-smells-rubric.mdreference/testing-async-await-flushpromises.mdreference/testing-browser-vs-node-runners.mdreference/testing-component-blackbox-approach.mdreference/testing-composables-helper-wrapper.mdreference/testing-e2e-playwright-recommended.mdreference/testing-no-snapshot-only.mdreference/testing-pinia-store-setup.mdreference/testing-suspense-async-components.mdreference/testing-vitest-recommended-for-vue.mdreference/vue-router-testing.mdVue-specific test-design advisor + test-code reviewer. Recommends how to test Vue 3 components, composables, Pinia stores, Vue Router, async/Suspense, Teleport, forms, and accessibility — and audits existing Vitest + Vue Test Utils tests for smells, gaps, and coverage risk. Read-only: it advises and reviews; it never runs, generates, or fixes tests.
This skill is to mk:testing what mk:vue-best-practices is to mk:vue — a
domain-specialized advisory that you invoke deliberately.
Invoke-only — this skill does NOT auto-activate. Activate it for:
/mk:vue-testing-best-practices [test file or component] (explicit).Do NOT invoke for (each routes to its owner):
mk:testingmk:reviewmk:nyquistmk:qa.spec.ts E2E → mk:qa-manualmk:agent-browser / mk:playwright-climk:vue / mk:vue-best-practices| You want to… | Use |
|---|---|
| Write/refactor Vue feature code | mk:vue |
| Review Vue feature code / authoring workflow | mk:vue-best-practices |
| Design or review Vue test code; choose test tooling | this skill |
| Actually run tests / TDD loop / non-Vue tests | mk:testing |
| Diff/PR review or "does a test exist for this change?" | mk:review |
| Map test coverage → requirements (which criteria are untested) | mk:nyquist |
| "does the running site work? find + fix bugs" | mk:qa |
| Generate runnable Playwright E2E specs from a spec/URL | mk:qa-manual |
| Drive a real browser | mk:agent-browser / mk:playwright-cli |
The seam is authoring vs test-setup:
mk:vue-best-practices.teleport stub, attachTo: document.body, querying
portalled content) → this skill.Teleport/Suspense authoring (when to use, API, fallback) → mk:vue-best-practices;
Teleport/Suspense test-setup (stubs, flushPromises, attachTo, mountSuspense) →
this skill.
Read one level deep from this file. Load only the reference that matches the surface.
| Problem / intent | Reference |
|---|---|
| Setting up test infrastructure for a Vue 3 project | reference/testing-vitest-recommended-for-vue.md |
| Tests break when refactoring component internals | reference/testing-component-blackbox-approach.md |
| Flaky/intermittent tests, async DOM not updated | reference/testing-async-await-flushpromises.md |
Composables using lifecycle hooks or inject fail to test | reference/testing-composables-helper-wrapper.md |
| "injection Symbol(pinia) not found" errors | reference/testing-pinia-store-setup.md |
Components with async setup() won't render | reference/testing-suspense-async-components.md |
| Snapshot tests pass despite broken functionality | reference/testing-no-snapshot-only.md |
| Choosing an end-to-end framework for a Vue app | reference/testing-e2e-playwright-recommended.md |
| Need to verify computed styles or real DOM events | reference/testing-browser-vs-node-runners.md |
defineAsyncComponent components fail in tests | reference/async-component-testing.md |
| Teleported content can't be found in wrapper queries | reference/teleport-testing-complexity.md |
Testing routing: useRoute/useRouter, navigation guards | reference/vue-router-testing.md |
| Testing forms: inputs, validation, submit payloads | reference/form-testing.md |
| Asserting accessibility in tests (roles, focus, keyboard) | reference/accessibility-testing.md |
| Reviewing tests for smells (the severity rubric) | reference/test-smells-rubric.md |
Read-only advisory lifecycle. Classify the surface → load the matching reference JIT → evaluate against the rubric → emit a bounded review.
reference/test-smells-rubric.md: blackbox vs
implementation-coupled? async awaited (flushPromises/nextTick)? Pinia configured?
Suspense/Teleport set up? snapshot policy? a11y queries? brittle locators?Entry criteria: a Vue 3 project, and the user wants test design, test review, or test tooling advice.
Stop conditions (hand off, do not attempt):
| Request | Hand off to |
|---|---|
| Execute / run tests, TDD loop | mk:testing |
Generate runnable E2E .spec.ts | mk:qa-manual |
| Drive a live browser | mk:agent-browser / mk:playwright-cli |
| Coverage→requirement map | mk:nyquist |
| QA a running app + fix bugs | mk:qa |
| Diff/PR review or test-existence gaps | mk:review |
| Root-cause a failing test/bug | mk:investigate |
Escalation: non-Vue test code → mk:testing; running-app bugs → mk:qa; root-cause
debugging → mk:investigate; coverage map → mk:nyquist.
Emit a single Vue Testing Review. Omit any empty section rather than padding it. Do not
restate Vue basics (defer to mk:vue), dump whole files, or recite generic testing theory.
PASS / NEEDS-WORK + a one-sentence why.[severity] · file:line · smell · fix. Severity vocab:
critical | high | medium | low. (e.g. implementation-coupling, snapshot-only, missing
await flushPromises, missing Pinia setup, brittle CSS locator.)mk:review references/test-coverage.md during a full review — this
section audits test quality, not existence.@vue/test-utils vs @testing-library/vue) / Playwright-vs-Cypress choices, each with a
one-line rationale.mk:testing,
E2E gen → mk:qa-manual, coverage map → mk:nyquist)."How should I test this Pinia-backed
UserProfilecomponent?"
Verdict: NEEDS-WORK — no Pinia provided, so the component will throw on mount.
Tooling: Vitest + happy-dom; @vue/test-utils + createTestingPinia({ createSpy: vi.fn }).
Missing Scenarios: loading state, fetch error, empty profile.
Handoffs: write + run the suite → mk:testing.
"Review
tests/SearchBar.spec.ts."
Verdict: NEEDS-WORK — assertions race ahead of async DOM updates.
Test Smells:
[high] · SearchBar.spec.ts:21 · setValue not awaited · `await wrapper.find('input').setValue(...)`
[medium] · SearchBar.spec.ts:30 · brittle `.btn-primary` locator · query by role/text or data-testid
Missing Scenarios: empty-query, no-results, API error.
await flushPromises() after an API call — await nextTick() only flushes
reactive DOM updates, not pending promises; an API-driven assertion runs against stale state
and the test flakes. Use flushPromises() (sometimes twice for chained async).createTestingPinia (component tests) or setActivePinia(createPinia()) (store unit tests)
throws on mount. Provide Pinia before asserting.<Teleport> moves DOM out of the component
subtree, so wrapper.find() misses it; stub Teleport or attachTo: document.body and query
the document.Ported and extended from an upstream Vue testing skill — see SYNC.md for the upstream path, pinned commit, and which references are vendored-verbatim vs toolkit.
npx claudepluginhub ngocsangyem/meowkit --plugin mkProvides Vue.js testing best practices using Vitest, Vue Test Utils, and Playwright for E2E. Covers component testing, mocking, async composables, Pinia stores, and common pitfalls.
Provides Vue.js testing best practices using Vitest, Vue Test Utils, and Playwright for E2E. Covers component testing, mocking, async composables, Pinia stores, and common pitfalls.
Guides authoring and reviewing frontend unit, component, and lightweight integration tests using React Testing Library, Vue Test Utils, accessible queries, user-event interactions, and controlled mocks.