frontend-testing
Generate Vitest + React Testing Library tests for Dify frontend components, hooks, and utilities. Triggers on testing, spec files, coverage, Vitest, RTL, unit tests, integration tests, or write/review test requests.
Security Assessment
About frontend-testing
The frontend-testing skill is designed to generate and review frontend tests for the Dify project using Vitest and React Testing Library (RTL). It helps developers create high-quality, convention-aligned test suites for frontend components, hooks, and utilities while reducing manual effort and improving test consistency. The skill is specifically intended for frontend testing workflows and follows the Dify testing conventions described in the referenced testing documentation, including the use of Vitest mocking and timer APIs (`vi.*`). It is not intended for backend testing with Python/pytest or end-to-end testing with Playwright and Cucumber.
Its main capabilities include generating test files for components, hooks, and utilities, reviewing existing tests for completeness, improving test coverage, and supporting spec-file creation and analysis workflows. The skill provides guidance on test structure, naming conventions, file placement, and recommended testing patterns such as rendering validation, props testing, user interaction testing, and edge-case handling. It also supports workflows involving `pnpm analyze-component` output and encourages best practices such as mocking external dependencies only, resetting mocks between tests, and using real project components and Zustand stores where appropriate.
This skill is particularly useful for frontend engineers working in the Dify codebase who need help writing or reviewing unit and integration tests. It is relevant when developers request help with Vitest, RTL, spec files, test coverage, or frontend testing patterns. Teams maintaining React-based frontend code can use it to standardize testing approaches, improve reliability, and accelerate test development while staying aligned with project-specific conventions.
FAQ
When should I use the frontend-testing skill?
Use this skill when writing or reviewing frontend tests for components, hooks, or utilities, especially when working with Vitest, React Testing Library, spec files, or test coverage improvements in the Dify frontend.
Does this skill support backend or API testing?
No. The skill is intended for frontend testing only and does not apply to backend or API tests using Python/pytest.
Can this skill be used for end-to-end testing?
No. It does not apply to E2E testing workflows such as Cucumber and Playwright under the `e2e/` directory.
What testing frameworks does this skill rely on?
The skill is based on Vitest and React Testing Library and follows Dify frontend testing conventions, including the use of Vitest mock and timer APIs (`vi.*`).
Are there file naming or placement requirements?
Yes. Test files should follow `.spec.ts` or `.spec.tsx` naming conventions and be placed inside a same-level `__tests__/` sibling directory relative to the source under test.
All Files
10 filesInstall frontend-testing
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
langgenius/dify