本文へスキップ
Skillpedia
テスト75k · #3070

unit-tests

できること

このスキルは、最も重要なロジックから始めて、焦点を絞った単体テストをコードベースに追加します。コードを変えるときの自信が欲しい開発者向けです。

使う場面

  • ✓重要な関数やコンポーネントに単体テストがないプロジェクトのとき。
  • ✓危険なコードをリファクタリングする前に、テストを用意したいとき。
  • ✓CIで実行され、リグレッションを早く見つけるテストをチームが求めているとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/unit-tests/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/unit-tests/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のチェックアウトの計算にはテストがなく、変更するのが怖いです。重要なロジックの単体テストを書いてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、テストされていない関数を見つけ、期待される動作を説明する焦点を絞ったテストを書きます。内部のモジュールではなく外部のサービスをモックし、テストが安定するようにします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Write unit tests

Unit tests catch bugs before they reach production, serve as documentation for expected behavior, and give developers confidence to refactor code without breaking functionality.

Quick Reference

  • Test business logic, utilities, and edge cases
  • Aim for 80%+ coverage on critical paths
  • Use descriptive test names that explain behavior
  • Mock external dependencies, not internal modules
  • Run tests in CI to catch regressions early

Check

Check if this codebase has unit tests with good coverage for critical functionality.

Fix

Write unit tests for untested functions and components to improve code reliability.

Explain

Explain how unit tests catch bugs early and serve as documentation for expected behavior.

Code Review

Review tests, CI workflows, and enforcement points related to Write unit tests. Flag exact gaps where the rule is not automatically verified or where failures do not block regressions.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/testing/unit-tests

よくある質問

テストのカバレッジはどのくらいあれば十分ですか?

このスキルは、すべての行を同じように重要とみなすのではなく、重要な経路で80パーセント以上を目指します。

テストは自動で実行すべきですか?

はい。このスキルは、リグレッションを早く見つけるため、CIで実行することを勧めています。

良いテスト名とは何ですか?

確認している動作を説明する、分かりやすい名前です。

詳細

作者による元の説明

Use when reviewing CI coverage, automated checks, or test strategy related to Write unit tests. Focus on whether the rule is continuously verified, not just documented.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#3070
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル