# Unit test vue pinia

> Unit test vue pinia is an open-source agent skill for developer tools. Guides an agent to write and review Vue 3 unit tests with Vitest and Pinia. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/github/awesome-copilot/tree/main/skills/unit-test-vue-pinia
- **Repository:** https://github.com/github/awesome-copilot
- **GitHub stars:** 41,794
- **License:** MIT
- **Skill name:** unit-test-vue-pinia
- **Collection:** https://github.com/github/awesome-copilot
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-30

## About

This skill directs an AI coding agent to create or review unit tests for Vue 3 components, composables and Pinia stores in TypeScript projects using Vitest. It pushes tests toward observable behavior: driving components through props, clicks, form input and emitted events, then asserting rendered output, emitted payloads and store state changes rather than internal instance details.

The workflow has the agent first pick the behavior boundary and the narrowest test style, then choose the least powerful Pinia setup that still covers the case. It covers when to use createTestingPinia with spied or stubbed actions, seeding state with initialState, executing real actions, and plain createPinia for pure store tests. It also points to a checked-in pinia-patterns reference file and the Vue Test Utils guide for conventions.

The agent is expected to flag brittle selectors, implementation-coupled assertions and missing coverage during reviews, and to state the assumptions behind its Pinia strategy. The skill is plain markdown instructions with no scripts; it needs a Vue 3, TypeScript, Vitest and Pinia project.

## When your agent uses it

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

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/github/awesome-copilot/tree/HEAD/skills/unit-test-vue-pinia)
- [License: MIT](https://github.com/github/awesome-copilot/tree/HEAD/skills/unit-test-vue-pinia)

## Features

- **Behavior-first test design:** Guides tests to assert rendered text, emitted events, callbacks and store changes instead of internals.
- **Pinia testing setups:** Covers createTestingPinia options such as spies, stubbed actions, initial state and plugins.
- **Vue Test Utils conventions:** Recommends shallow mounting, event-based child interaction and limited use of wrapper.vm.
- **Store unit testing:** Describes pure store tests with createPinia and setActivePinia for state transitions.
- **Test review checklist:** Flags brittle selectors, snapshot overuse and implementation-coupled assertions with coverage gaps.

## Good for

- Write Vitest unit tests for a Vue component that emits a submit event
- Add store tests for a Pinia counter with state transitions
- Mock a Pinia store in a component test using createTestingPinia
- Review an existing Vue test suite for implementation-coupled assertions
- Seed Pinia state for a component test with initial data

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/unit-test-vue-pinia` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/unit-test-vue-pinia &&
cp -R "$tmp/skills/unit-test-vue-pinia" ~/.claude/skills/unit-test-vue-pinia &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/unit-test-vue-pinia` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/unit-test-vue-pinia` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/unit-test-vue-pinia &&
cp -R "$tmp/skills/unit-test-vue-pinia" ~/.agents/skills/unit-test-vue-pinia &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/unit-test-vue-pinia` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/unit-test-vue-pinia` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/unit-test-vue-pinia &&
cp -R "$tmp/skills/unit-test-vue-pinia" ~/.cursor/skills/unit-test-vue-pinia &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/unit-test-vue-pinia` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/github/awesome-copilot.git --path skills/unit-test-vue-pinia
```

Or copy the folder to `~/.gemini/skills/unit-test-vue-pinia` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/unit-test-vue-pinia`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/unit-test-vue-pinia &&
cp -R "$tmp/skills/unit-test-vue-pinia" ~/.copilot/skills/unit-test-vue-pinia &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/unit-test-vue-pinia` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/github/awesome-copilot.git
```

Then copy `awesome-copilot/skills/unit-test-vue-pinia` into your agent's skills folder as `unit-test-vue-pinia`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It is a set of markdown instructions with no scripts. It targets Vue 3, TypeScript, Vitest and Pinia projects and refers to Vue Test Utils and the Pinia testing cookbook.

### When does the skill apply?

It applies when creating or updating tests for components, composables and stores, mocking Pinia with createTestingPinia, or reviewing tests for black-box assertions.

### Does Unit test vue pinia mock Pinia actions by default?

Actions are stubbed and spied by default with createTestingPinia. Real actions are only enabled with stubActions set to false when the test must validate actual behavior.

### How do I install Unit test vue pinia in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/unit-test-vue-pinia to use it in all your projects, or to .claude/skills/unit-test-vue-pinia in one project.

### Does Unit test vue pinia run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Unit test vue pinia?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Unit test vue pinia?

The closest alternatives to Unit test vue pinia are Vue, Vitest skill, Vue data, Vue review and Build tooling.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Vue](https://ai-powered.com/skills/vue): Vue is an open-source agent skill for developer tools.
- [Vitest skill](https://ai-powered.com/skills/vitest-skill): Vitest skill is an open-source agent skill for developer tools.
- [Vue data](https://ai-powered.com/skills/vue-data): Vue data is an open-source agent skill for developer tools.
- [Vue review](https://ai-powered.com/skills/vue-review): Vue review is an open-source agent skill for developer tools.
- [Build tooling](https://ai-powered.com/skills/build-tooling): Build tooling is an open-source agent skill for developer tools.
- [Jest skill](https://ai-powered.com/skills/jest-skill): Jest skill is an open-source agent skill for developer tools.
- [Vue debug](https://ai-powered.com/skills/vue-debug): Vue debug is an open-source agent skill for developer tools.
- [Phpunit skill](https://ai-powered.com/skills/phpunit-skill): Phpunit skill is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/unit-test-vue-pinia
