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.
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.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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
- Workflow
- Core Rules
- Pinia Testing Approach
- Default pattern for component tests
- Accepted minimal Pinia setups
- Execute real actions only when needed
- Seed store state with initialState
- Add Pinia plugins through createTestingPinia
- Getter override pattern for edge cases
- Pure store unit tests
- Vue Test Utils Approach
- Key Testing Snippets
- Test Writing Workflow
- Constraints and Safety
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.