create-test

Generate Vitest unit test scaffolds for components under tests/components.

284|31|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/wot-ui/wot-ui --skill create-test-wot-ui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-test
Source: https://github.com/wot-ui/wot-ui/tree/main/.agents/skills/create-test
Command: npx skills add https://github.com/wot-ui/wot-ui --skill create-test-wot-ui

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

为组件创建单元测试提供标准化流程,降低重复工作并提升代码库的测试覆盖率。

Core Features & Use Cases

  • 自动化测试脚手架:在 tests/components 目录下创建 wd-{组件名}.test.ts,遵循命名约定。
  • 测试模版:提供渲染、Props、事件、插槽等测试模版,便于快速扩展覆盖。
  • 场景覆盖:支持对常见组件的回归测试及边界情况的验证,便于持续集成。
  • 复用与扩展:可结合 mocks、外部依赖和自定义断言增强测试鲁棒性。

Quick Start

Create a new test file named wd-{组件名}.test.ts under tests/components, implement tests according to the provided template, then run the test suite.

Frequently Asked Questions about create-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a Vitest unit test scaffold for a Vue component?

To generate a Vitest unit test scaffold, identify the component and the tool creates a wd-<component>.test.ts file under tests/components, covering basic rendering, props, events, and slots.

What is the standard file naming convention for component unit tests?

The standard naming convention for component unit tests requires placing files in the tests/components directory using the wd-<component>.test.ts format to ensure consistent test discovery and execution.

How do I test component props, events, and slots using vue-test-utils?

You test component props, events, and slots by applying the provided testing templates, which generate scaffold code to verify basic rendering and component interactions for robust regression testing.

Can I use mocks and custom assertions in my component testing templates?

Yes, you can integrate mocks, external dependencies, and custom assertions into the generated component testing templates to enhance test robustness and verify edge cases.

What's the best way to verify unit test coverage for edge cases in CI?

The best way to verify unit test coverage in CI is to run the test suite with npm run test, which validates the generated Vitest scaffolds and allows you to adjust tests for edge cases as needed.