This skill enables Claude to generate high-quality, comprehensive frontend tests for the Dify project following established conventions and best practices. > **⚠️ Authoritative Source**: This skill is derived from `web/docs/test.md`. Use Vitest mock/timer APIs (`vi.*`). ## When to Apply This Skill Apply this skill when the user: - Asks to **write tests** for a component, hook, or utility - Asks to **review existing tests** for completeness - Mentions **Vitest**, **React Testing Library**, **RTL**, or **spec files** - Requests **test coverage** improvement - Uses `pnpm analyze-component` output as context - Mentions **testing**, **unit tests**, or **integration tests** for frontend code - Wants to understand **testing patterns** in the Dify codebase **Do NOT apply** when: - User is asking about backend/API tests (Python/pytest) - User is asking about E2E tests (Playwright/Cypress) - User is only asking conceptual questions without code context ## Quick Reference ### Tech Stack | Tool | Version | Purpose | |------|---------|---------| | Vitest | 4.0.16 | Test runner | | React Testing Library | 16.0 | Component testing | | jsdom | - | Test environment | | nock | 14.0 | HTTP mocking | | TypeScript | 5.x | Type safety | ### Key Commands ```bash # Run all tests pnpm test # Watch mode pnpm test:watch # Run specific file pnpm test path/to/file.spec.tsx # Generate coverage report pnpm test:coverage # Analyze component complexity pnpm analyze-component # Review existing test pnpm analyze-component --review ``` ### File Naming - Test files: `ComponentName.spec.tsx` (same directory as component) - Integration tests: `web/__tests__/` directory ## Test Structure Template ```typescript import { render, screen, fireEvent, waitFor } from '@testing-library/react'
Philosophy
Skillora では、スキルを売る人も買う人も同じコミュニティにいます。 気に入った作者の新作やアップデートを追いかけたり、自分も出品して還元を受け取ったり。 好きなクリエイターをフォローして、発見と応援をひとつの場所で。
購入後にターミナルで実行してください。
正規購入者にはインストールコマンド再実行で最新版が配信されます。
継続的な価値を提供します
Skilloraのスキルはライセンス認証で保護されており、定期的にアップデートされます。スクリーンショットやコピーでは最新版を受け取れず、バグ修正や新機能の恩恵も得られません。正規購入者には常に最新バージョンが自動配信されます。
利用規約を確認 →—
評価なし
まだレビューがありません。最初のレビューを書いてみましょう。
Free
無料で導入共有する
SNS・リンクで広める
Frontend Testing — AIの使い方が変わるスキル
Vitest + RTL tests for frontend components/hooks. Triggers on testing, spec files, coverage, Vitest, RTL, unit tests, integration tests.
https://skillora.jp/skills/frontend-testing
この作者の他のスキル
このスキルに似たスキル
Skillora Quick Publish
Freeスキルファイル渡すだけで全自動出品。ヒアリングなし即掲載。
Meta Orchestrator
Freeチェックリスト駆動で一気通貫実行するスキル v3.2。「メタオーケストラで」と明示時のみ起動。 新機能・UI改善・バグ修正・監査など規模不問。「メタオーケストラで○○して」で必ず使うこと。 v3.2: worktree並列ビルド / Spec File駆動 / 150行バジェット追加
Blitz Ios
FreeBlitz — iOS開発自動化(macOS専用)。シミュレーター〜App Store提出まで全自動。 トリガー: iOS開発、iOSアプリ、シミュレーター、App Store提出、Xcode自動化、Swift開発、React Native iOS、Flutter iOS、blitz