Use this skill to create or review unit tests for Vue components, composables, and Pinia stores. Keep tests small, deterministic, and behavior-first.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionunit-test-vue-piniaExecute the skills CLI command in your project's root directory to begin installation:
Fetches unit-test-vue-pinia from github/awesome-copilot and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate unit-test-vue-pinia. Access via /unit-test-vue-pinia in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
28.7K
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
28.7K
stars
Use this skill to create or review unit tests for Vue components, composables, and Pinia stores. Keep tests small, deterministic, and behavior-first.
wrapper.vm only in exceptional cases when there is no reasonable DOM, prop, emit, or store-level assertion.beforeEach() and reset mocks every test.references/pinia-patterns.md as the local source of truth for standard Pinia test setups.Use references/pinia-patterns.md first, then fall back to Pinia's testing cookbook when the checked-in examples do not cover the case.
Use createTestingPinia as a global plugin while mounting.
Prefer createSpy: vi.fn as the default for consistency and easier action-spy assertions.
const wrapper = mount(ComponentUnderTest, {
global: {
plugins: [
createTestingPinia({
createSpy: vi.fn,
}),
],
},
});
By default, actions are stubbed and spied.
Use stubActions: true (default) when the test only needs to verify whether an action was called (or not called).
The following are also valid and should not be flagged as incorrect:
createTestingPinia({}) when the test does not assert Pinia action spy behavior.createTestingPinia({ initialState: ... }) or createTestingPinia({ stubActions: ... }) without createSpy, when the test only needs state seeding or action stubbing behavior and does not inspect generated spies.setActivePinia(createTestingPinia(...)) in store/composable-focused tests (without mounting a component) when mocking/seeding dependent stores is needed.Use createSpy: vi.fn when action spy assertions are part of the test intent.
Use stubActions: false only when the test must validate the action's real behavior and side effects. Do not switch it on by default for simple "was called" assertions.
const wrapper = mount(ComponentUnderTest, {
global: {
plugins: [
createTestingPinia({
createSpy: vi.fn,
stubActions: false,
}),
],
},
});
initialStateconst wrapper = mount(ComponentUnderTest, {
global: {
plugins: [
createTestingPinia({
createSpy: vi.fn,
initialState: {
counter: { n: 20 },
user: { name: "Leia Organa" },
},
}),
],
},
});
createTestingPiniaconst wrapper = mount(ComponentUnderTest, {
global: {
plugins: [
createTestingPinia({
createSpy: vi.fn,
plugins: [myPiniaPlugin],
}),
],
},
});
const pinia = createTestingPinia({ createSpy: vi.fn });
const store = useCounterStore(pinia);
store.double = 999;
// @ts-expect-error test-only reset of overridden getter
store.double = undefined;
Prefer pure store tests with createPinia() when the goal is to validate store state transitions and action behavior without component rendering. Use createTestingPinia() only when you need stubbed dependent stores, seeded test doubles, or action spies.
beforeEach(() => {
setActivePinia(createPinia());
});
it("increments", () => {
const counter = useCounterStore();
counter.increment();
expect(counter.n).toBe(1);
});
Follow Vue Test Utils guidance: https://test-utils.vuejs.org/guide/
findComponent(...).vm.$emit(...) for child stub events instead of touching parent internals.nextTick only when updates are async.wrapper.emitted(...).wrapper.vm only when no DOM assertion, emitted event assertion, prop assertion, or store-level assertion can express the behavior. Treat it as an exception and keep the assertion narrowly scoped.Emit and assert payload:
await wrapper.find("button").trigger("click");
expect(wrapper.emitted("submit")?.[0]?.[0]).toBe("Mango Mission");
Update input and assert output:
await wrapper.find("input").setValue("Agent Violet");
await wrapper.find("form").trigger("submit");
expect(wrapper.emitted("save")?.[0]?.[0]).toBe("Agent Violet");
create or update, return the finished test code plus a short note describing the selected Pinia strategy.review, return concrete findings first, then missing coverage or brittleness risks.references/pinia-patterns.mdPrerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
github/awesome-copilot
github/awesome-copilot
anthropics/claude-code
mblode/agent-skills
sickn33/antigravity-awesome-skills
leonxlnx/taste-skill
We added unit-test-vue-pinia from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
unit-test-vue-pinia reduced setup friction for our internal harness; good balance of opinion and flexibility.
Useful defaults in unit-test-vue-pinia — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Solid pick for teams standardizing on skills: unit-test-vue-pinia is focused, and the summary matches what you get after install.
Registry listing for unit-test-vue-pinia matched our evaluation — installs cleanly and behaves as described in the markdown.
Useful defaults in unit-test-vue-pinia — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
unit-test-vue-pinia reduced setup friction for our internal harness; good balance of opinion and flexibility.
unit-test-vue-pinia fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Useful defaults in unit-test-vue-pinia — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
unit-test-vue-pinia is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
showing 1-10 of 67