·vitest-testing
</>

vitest-testing

用於單元、元件和整合測試的 Vitest 測試框架。涵蓋測試結構 (describe/it/test.each)、expect 斷言、生命週期鉤子、模擬 (vi.fn/vi.mock/vi.spyOn)、React 測試庫模式、renderHook 鉤子測試、用戶事件交互、非同步實用程式、配置、工作區設定、覆蓋率以及高級模式(如來源內測試和並行執行)。還涵蓋 CLI 命令、測試過濾、標籤、分片、帶有 test.extend 的固定裝置以及固定裝置作用域。 在編寫單元測試、元件測試、整合測試或測試 React hook 時使用。用於測試配置、模擬模組、測試異步行為、快照測試或設定測試覆蓋率。

34安裝·4熱度·@oakoss

安裝

$npx skills add https://github.com/oakoss/agent-skills --skill vitest-testing

如何安裝 vitest-testing

透過命令列快速安裝 vitest-testing AI 技能到你的開發環境

  1. 開啟終端機: 開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 執行安裝指令: 複製並執行以下指令:npx skills add https://github.com/oakoss/agent-skills --skill vitest-testing
  3. 驗證安裝: 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

來源:oakoss/agent-skills。

SKILL.md

查看原文

Vitest is a Vite-native unit testing framework that shares the same configuration and plugin ecosystem. Built for speed with native ESM support, hot module replacement for tests, and parallel execution.

When to use: Unit tests, component tests, integration tests, hook tests, in-source tests. Testing React components with React Testing Library. Testing TanStack Query/Router/Form patterns.

When NOT to use: End-to-end testing (use Playwright), visual regression testing (use Percy/Chromatic), load testing (use k6).

用於單元、元件和整合測試的 Vitest 測試框架。涵蓋測試結構 (describe/it/test.each)、expect 斷言、生命週期鉤子、模擬 (vi.fn/vi.mock/vi.spyOn)、React 測試庫模式、renderHook 鉤子測試、用戶事件交互、非同步實用程式、配置、工作區設定、覆蓋率以及高級模式(如來源內測試和並行執行)。還涵蓋 CLI 命令、測試過濾、標籤、分片、帶有 test.extend 的固定裝置以及固定裝置作用域。 在編寫單元測試、元件測試、整合測試或測試 React hook 時使用。用於測試配置、模擬模組、測試異步行為、快照測試或設定測試覆蓋率。 來源:oakoss/agent-skills。

可引用資訊

為搜尋與 AI 引用準備的穩定欄位與指令。

安裝指令
npx skills add https://github.com/oakoss/agent-skills --skill vitest-testing
分類
</>開發工具
認證
收錄時間
2026-02-22
更新時間
2026-03-10

Browse more skills from oakoss/agent-skills

快速解答

什麼是 vitest-testing?

用於單元、元件和整合測試的 Vitest 測試框架。涵蓋測試結構 (describe/it/test.each)、expect 斷言、生命週期鉤子、模擬 (vi.fn/vi.mock/vi.spyOn)、React 測試庫模式、renderHook 鉤子測試、用戶事件交互、非同步實用程式、配置、工作區設定、覆蓋率以及高級模式(如來源內測試和並行執行)。還涵蓋 CLI 命令、測試過濾、標籤、分片、帶有 test.extend 的固定裝置以及固定裝置作用域。 在編寫單元測試、元件測試、整合測試或測試 React hook 時使用。用於測試配置、模擬模組、測試異步行為、快照測試或設定測試覆蓋率。 來源:oakoss/agent-skills。

如何安裝 vitest-testing?

開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/oakoss/agent-skills --skill vitest-testing 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

這個 Skill 的原始碼在哪?

https://github.com/oakoss/agent-skills

詳情

分類
</>開發工具
來源
skills.sh
收錄時間
2026-02-22