Skip to content
Back to skills

Testing Standards

ASecurity

測試標準。定義測試策略、命名慣例、覆蓋率要求等。 QA Reviewer agent 應注入此 skill,開發類 agent 可選擇性注入。

  • 34 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
testingtypescriptreacttestingapi

Works with

  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add maxyeh0817/Forge --skill testing-standards --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Standards?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Standards
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/maxyeh0817-testing-standards/badge)](https://www.skillsdirectory.com/skills/maxyeh0817-testing-standards)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-standards
description: >
  測試標準。定義測試策略、命名慣例、覆蓋率要求等。
  QA Reviewer agent 應注入此 skill,開發類 agent 可選擇性注入。
---

# Testing Standards 規範

## 測試策略
- 單元測試:核心業務邏輯、工具函數
- 整合測試:API 端點、資料庫操作
- 元件測試:關鍵 UI 元件的渲染和互動
- E2E 測試:核心用戶流程(視專案規模決定是否需要)

## 測試框架
- 單元/整合測試:Vitest(優先)或 Jest
- 元件測試:React Testing Library
- E2E 測試:Playwright(如需要)

## 命名慣例
- 測試檔案:`{module}.test.ts` 或 `{module}.spec.ts`
- 測試描述:使用中文或英文皆可,保持一致
- describe:描述被測試的模塊/函數
- it/test:描述預期行為(「should ...」或「當...時,應該...」)

## 測試結構
```typescript
describe('模塊名稱', () => {
  describe('函數/方法名稱', () => {
    it('should 預期行為 when 條件', () => {
      // Arrange
      // Act
      // Assert
    })
  })
})
```

## 品質標準
- 每個 API 端點至少有 happy path + error path 測試
- 工具函數覆蓋率目標:80%+
- 測試應獨立、可重複執行
- 避免測試實作細節,測試行為和結果
- Mock 外部依賴(API 呼叫、資料庫)

## 稽核檢查清單
- [ ] 測試是否覆蓋完成定義中的所有驗收條件
- [ ] 測試是否包含邊界情況
- [ ] 測試是否可獨立執行(不依賴外部狀態)
- [ ] 測試命名是否清晰描述預期行為
- [ ] 是否有不必要的 snapshot 測試

## 已知注意事項
(由 QA 迭代時追加)

> 詳細模式參考:references/patterns.md
> 歷史教訓:references/lessons.md

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…