← Explore all skills

TESTING AND RELIABILITY / GitHub community

Vue 3 Pinia Unit Testing

Writes and reviews unit tests for Vue 3 + TypeScript + Vitest + Pinia codebases: behavior-first assertions on components, composables and stores, with createTestingPinia setups from a checked-in pattern cookbook.

“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.”

01 / THE REASONING

Why this made the selection.

  • Structures the work around the behavior boundary first — component UI, composable or store — and restricts wrapper.vm access to exceptional cases, enforcing black-box assertions over implementation details.
  • Treats the checked-in references/pinia-patterns.md as the local source of truth for standard Pinia test setups and falls back to Pinia's cookbook only when the checked-in examples do not cover the case.

02 / THE REVIEW RECORD

What we actually inspected.

Source review has boundaries.
A clear record is more useful than a “safe” badge.

Material inspected

  • skills/unit-test-vue-pinia/SKILL.md
  • skills/unit-test-vue-pinia/references/pinia-patterns.md
  • LICENSE
  • vercel-labs/skills@7407f3893ad4dceab546ac002c3ef806e4000c73:README.md

Our findings

  • Core rules require one behavior per test, observable input/output assertions before any instance-level check, and mock resets in beforeEach.
  • The cookbook shows createTestingPinia with createSpy: vi.fn as the default and toggling stubActions only when behavior inside an action must actually run.
  • The workflow ends by returning or reviewing tests with behavior-oriented names and noting remaining coverage gaps rather than claiming completion.
  • The definition accepts minimal createTestingPinia setups without createSpy when action-spy assertions are absent, and limits real action execution to tests that need action behavior or side effects.

Not established by this review

  • No Vue component, composable or store test was written or run.
  • The Vitest and @pinia/testing toolchain was not executed.
  • Not executed: it was not installed or run.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

Add a skill to your workflow.

Upstream setup instructions ↗

DOCUMENTED COMMAND

npx skills add github/awesome-copilot/skills/unit-test-vue-pinia

Run in your terminal to choose your AI tools, project or global scope, and installation method. This short command follows the current upstream version; the review covers the revision shown above.

Optional: install the reviewed revision

Keeps the original source and installer version where recorded, while leaving your AI tools and installation scope for you to choose.

npx skills add https://github.com/github/awesome-copilot/tree/2dfe04eaeb5faf9c168d78041d660c0123893d85/skills/unit-test-vue-pinia
  1. Install the complete skill directory with its references; the pinia-patterns cookbook is the working reference.
  2. Choose your AI tools and project or global scope in the installer, then review its permissions before using the skill.

Before you start

  • Node.js/npm for this installer
  • An agent that supports the Agent Skills format
  • A Vue 3 project with Vitest, Pinia, @pinia/testing and @vue/test-utils installed

04 / FOLLOW THE EVIDENCE

The source trail.

Our notes are separate from the original resource.
Check upstream before adopting a new version.

  1. https://github.com/github/awesome-copilot/blob/2dfe04eaeb5faf9c168d78041d660c0123893d85/skills/unit-test-vue-pinia/SKILL.md

    Supports: summary, upstreamDescription, whySelected, bestFor, limitations, review, compatibility, access

  2. https://github.com/github/awesome-copilot/blob/2dfe04eaeb5faf9c168d78041d660c0123893d85/skills/unit-test-vue-pinia/references/pinia-patterns.md

    Supports: review, whySelected, bestFor

  3. https://github.com/github/awesome-copilot/blob/2dfe04eaeb5faf9c168d78041d660c0123893d85/LICENSE

    Supports: license

  4. https://github.com/github/awesome-copilot/blob/2dfe04eaeb5faf9c168d78041d660c0123893d85/README.md

    Supports: install, compatibility, access

  5. https://github.com/vercel-labs/skills/blob/7407f3893ad4dceab546ac002c3ef806e4000c73/README.md

    Supports: install

  6. https://raw.githubusercontent.com/github/awesome-copilot/2dfe04eaeb5faf9c168d78041d660c0123893d85/skills/unit-test-vue-pinia/SKILL.md

    Supports: review.findings, bestFor

Evidence & Ask