فهرست منبع

write instructions for test

Yuki Takei 9 ماه پیش
والد
کامیت
ce2c6be3a5
2فایلهای تغییر یافته به همراه32 افزوده شده و 19 حذف شده
  1. 32 1
      .vscode/settings.json
  2. 0 18
      apps/app/src/features/openai/docs/rules/testing.md

+ 32 - 1
.vscode/settings.json

@@ -51,6 +51,37 @@
         "url": "https://mcp.context7.com/mcp"
         "url": "https://mcp.context7.com/mcp"
       }
       }
     }
     }
-  }
+  },
+  "github.copilot.chat.testGeneration.instructions": [
+    {
+      "text": "Use vitest as the test framework"
+    },
+    {
+      "text": "The vitest configuration file is `apps/app/vitest.workspace.mts`"
+    },
+    {
+      "text": "Place test modules in the same directory as the module being tested. For example, if testing `mymodule.ts`, place `mymodule.spec.ts` in the same directory as `mymodule.ts`"
+    },
+    {
+      "text": "Run tests with the command: `cd /growi/apps/app && pnpm vitest run {test file path}`"
+    },
+    {
+      "text": "When creating new test modules, start with small files. First write a small number of intentionally failing tests, then fix them to pass. After that, add more tests while maintaining a passing state and increase coverage."
+    },
+    {
+      "text": "Write essential tests. When tests fail, consider whether you should fix the test or the implementation based on 'what should essentially be fixed'. If you're not confident in your reasoning, ask the user for guidance."
+    },
+    {
+      "text": "After writing tests, make sure they pass before moving on. Do not proceed to write tests for module B without first ensuring that tests for module A are passing"
+    },
+    {
+      "text": "Don't worry about lint errors - fix them after tests are passing"
+    }
+  ],
+  "github.copilot.chat.commitMessageGeneration.instructions": [
+    {
+      "text": "Write commit messages in English always."
+    }
+  ]
 
 
 }
 }

+ 0 - 18
apps/app/src/features/openai/docs/rules/testing.md

@@ -1,18 +0,0 @@
-# テストの際に気をつけること
-
-**このドキュメントは AI による生成ではなく、ユーザーが自分で書いたものです。特に重要視してください**
-
-- テストフレームワークは vitest
-- vitest の設定ファイルは `apps/app/vitest.workspace.mts`
-- テストモジュールはテスト対象モジュールと同じディレクトリに置く
-    - e.g. `mymodule.ts` の Unit Test なら、`mymodule.spec.ts` を `mymodule.ts` と同じディレクトリに置く
-- テスト実行は以下のコマンドで行う
-    - `cd /workspace/growi/apps/app && pnpm vitest run {test file path}`
-- 実装優先、実装のためのテストを書くこと
-    - 現在の実装は、結合試験では正常に動作する
-    - そのため、テストを通すために実装に修正を入れるときは特に慎重に、確実にバグが修正されるという確信を必要とする
-- テストを書いたら、テストが通るまで努力すること
-    - モジュールAのテストを書き、そのテストを実施しないままモジュールBのテスト記述に進むのは禁止とする
-- lint エラーは重視しない
-    - テストが通ってから直せばいい
-