vue-test-utils-auto

A set of standards for testing Vue 3 components with Vue Test Utils and Vitest. It focuses on props, emitted events, slots, user interactions, mocks, and observable behavior.

In plain words
What is it for?
Use it to write or review typed tests for Vue components, including rendering, interactions, emitted events, slots, composables, and external dependencies.
Why use it?
It helps tests check what a component does for users instead of depending on its internal implementation.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/usrrname/cursorrules/vue-test-utils-auto
Clone the repo
git clone --depth 1 https://github.com/usrrname/cursorrules

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,977 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01977
Opus 5 $0.00000 $0.00988
Sonnet 5 $0.00000 $0.00395
Haiku 4.5 $0.00000 $0.00198

Measured 2d ago against content hash 84c14a04b5b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

vue-test-utils-auto scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/test/vue-test-utils-auto.mdc · 275 lines

How it starts

The opening of the file, as written. The whole thing — 275 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vue Test Utils Standards

Comprehensive testing standards for Vue 3 components using @vue/test-utils with TypeScript support.

Critical Rules

  • Use @vue/test-utils with TypeScript for type-safe component testing
  • Test component props, emits, slots, and user interactions thoroughly
  • Mock composables and external dependencies appropriately
  • Use data-testid attributes for reliable element selection
  • Test component behavior, not implementation details
  • Provide proper TypeScript types for test props and mocks
  ✅ Good component test structure:
  import { mount, VueWrapper } from "@vue/test-utils"
  import { describe, it, expect, vi, beforeEach } from "vitest"
  import UserProfile from "@/components/UserProfile.vue"
  import type { User } from "@/types/user"
  
  describe("UserProfile.vue", () => {
    let wrapper: VueWrapper<any>
    const mockUser: User = {
      id: 1,
      name: "John Doe",
      email: "[email protected]"
    }
    
    beforeEach(() => {
      wrapper = mount(UserProfile, {
        props: { user: mockUser }
      })
    })
    
    it("renders user information correctly", () => {
      expect(wrapper.find('[data-testid="user-name"]').text()).toBe("John Doe")
      expect(wrapper.find('[data-testid="user-email"]').text()).toBe("[email protected]")
    })
    
    it("emits update event when edited", async () => {
      await wrapper.find('[data-testid="edit-button"]').trigger("click")
      expect(wrapper.emitted("update")).toBeTruthy()
    })
  })
  
  ❌ Avoid untyped tests and unclear selectors:
  const wrapper = mount(UserProfile)
  expect(wrapper.find(".user-name").text()).toBe("John")

examples:

  • input: | import { mount } from "@vue/test-utils" const wrapper = mount(UserProfile) expect(wrapper.find(".user-name").text()).toBe("John") output: | import { mount, VueWrapper } from "@vue/test-utils" import type { User } from "@/types/user"

Read the full file on GitHub · 275 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 275 lines · 1,977 tokens per session scan A 84c14a04b5b3

Subscribe to this mod's changes

vue-test-utils-auto is a cursor rule published in the GitHub repository usrrname/cursorrules (10 stars, last pushed 4mo ago), licensed ISC. It costs nothing until one of its globs matches a file; then it loads 1,977 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.