Agent skill · Testing & QA

unit-test-vue-pinia

Write and review unit tests for Vue 3 + TypeScript + Vitest + Pinia codebases. Use when creating or updating tests for components, composables, and stores; mocking Pinia with createTestingPinia; applying Vue Test Utils patterns; and enforcing black-box assertions over implementation details.

GitHub68,948★ · +463/wk · 2 repos on radarProfile →
copilotMIT
Install
npx skills add github/awesome-copilot --skill unit-test-vue-pinia --agent copilot

Same command for any agent — swap --agent for claude-code, codex, cursor.

Facts
Files in the skill folder: 2
SKILL.md size: 7 KB
Bundled scripts: none
Path: skills/unit-test-vue-pinia/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 37,432 · +281 this week
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# unit-test-vue-pinia Use this skill to create or review unit tests for Vue components, composables, and Pinia stores. Keep tests small, deterministic, and behavior-first. ## Workflow 1. Identify the behavior boundary first: component UI behavior, composable behavior, or store behavior. 2. Choose the narrowest test style that can prove that behavior. 3. Set up Pinia with the least powerful option that still covers the scenario. 4. Drive the test through public inputs such as props, form updates, button clicks, emitted child events, and store APIs. 5. Assert observable outputs and side effects before considering any instance-level assertion. 6. Return or review tests with clear behavior-oriented names and note any remaining coverage gaps. ## Core Rules - Test one behavior per test. - Assert observable input/output behavior first (rendered text, emitted events, callback calls, store state changes). - Avoid implementation-coupled assertions. - Access `wrapper.vm` only in exceptional cases when there is no reasonable DOM, prop, emit, or store-level assertion. - Prefer explicit setup in `beforeEach()` and reset mocks every test. - Use checked-in reference material in `references/pinia-p

What's inside
Steps it walks through
  1. Workflow
  2. Core Rules
  3. Pinia Testing Approach
  4. Default pattern for component tests
  5. Accepted minimal Pinia setups
  6. Execute real actions only when needed
  7. Seed store state with initialState
  8. Add Pinia plugins through createTestingPinia
  9. Getter override pattern for edge cases
  10. Pure store unit tests
  11. Vue Test Utils Approach
  12. Key Testing Snippets
  13. Test Writing Workflow
  14. Constraints and Safety
Ships with 1 file
  • references/pinia-patterns.md
More from awesome-copilot
All skills →
About this skill
What does the unit-test-vue-pinia skill do?

Write and review unit tests for Vue 3 + TypeScript + Vitest + Pinia codebases. Use when creating or updating tests for components, composables, and stores; mocking Pinia with createTestingPinia; applying Vue Test Utils patterns; and enforcing black-box assertions over implementation details.

How do I install it?

Run `npx skills add github/awesome-copilot --skill unit-test-vue-pinia --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From github/awesome-copilot, a repository with 37,432 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going