vue-testing_skill

This skill helps you master Vue testing with Vitest, Vue Test Utils, and Playwright to deliver reliable unit, component, and e2e tests.
  • Python

1

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill pluginagentmarketplace/custom-plugin-vue --skill vue-testing

  • SKILL.md6.7 KB

Overview

This skill teaches production-grade testing for Vue applications using Vitest, Vue Test Utils, and Playwright. It covers unit, component, integration, and end-to-end strategies, plus effective mocking and store/composable testing. Outcomes include a repeatable test setup, reliable component tests, and stable E2E suites.

How this skill works

The skill guides you through progressive modules: environment setup with Vitest, component testing with Vue Test Utils, mocking strategies, composable and Pinia store testing, and Playwright E2E scenarios. It provides templates, configuration snippets, validation checkpoints, retry logic, and troubleshooting steps to turn learning into production-ready tests. Practical examples show mounting, event emission, mocking, and full-page flows.

When to use it

  • When establishing a Vue test environment and coverage targets
  • When writing or reviewing component tests and test structure
  • When mocking APIs, composables, timers, or stores for reliable unit tests
  • When validating business flows with Playwright E2E tests
  • When improving test reliability and reducing flakiness in CI

Best practices

  • Use mount() for full DOM behavior; shallowMount only when isolating child components
  • Centralize mocks at the top of test files (vi.mock) and prefer MSW for HTTP mocking
  • Set Vitest globals and jsdom environment for consistent DOM tests
  • Isolate tests with beforeEach cleanup and setActivePinia(createPinia()) for store tests
  • Add explicit awaits for async behavior and use Playwright fixtures for reusable setup

Example use cases

  • Set up Vitest with Vue, run initial component tests and enforce 80% coverage threshold
  • Test a button component: render text, assert props, trigger click, verify emitted event
  • Mock an API service and test async loading/error states in a component
  • Unit-test a composable: call functions and assert reactive values change
  • Write Playwright E2E for login flow: fill fields, submit, assert navigation to dashboard

FAQ

Vitest is recommended for speed and native Vite integration; Jest can be used if your project already depends on it.

How do I avoid flaky E2E tests?

Use stable selectors, add explicit waits for network or UI readiness, enable Playwright tracing, and isolate test state with fixtures.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational