什麼是 write-tests?
使用正確的模擬模式將測試覆蓋率新增至現有程式碼。在未經測試的模組中新增測試、為錯誤編寫回歸測試或使用者要求測試特定檔案時使用。處理mockReset:true、vi.hoisted()、轉發模式和測試應用程式建構器實用程式。 來源:acedergren/agentic-tools。
使用正確的模擬模式將測試覆蓋率新增至現有程式碼。在未經測試的模組中新增測試、為錯誤編寫回歸測試或使用者要求測試特定檔案時使用。處理mockReset:true、vi.hoisted()、轉發模式和測試應用程式建構器實用程式。
透過命令列快速安裝 write-tests AI 技能到你的開發環境
來源:acedergren/agentic-tools。
| Route handler | Test app builder + session simulation + app.inject() | | Repository | Mock DB connection + counter-based execute | | Framework plugin | Real framework instance + selective dependency mocks | | Pure utility | No mocks — test inputs/outputs directly | | Service w/ DI | Mock injected deps via forwarding pattern |
If your test runner uses mockReset: true, most examples from the internet will silently fail.
For complex TDZ cases (multiple interdependent mocks), use the globalThis registry pattern.
使用正確的模擬模式將測試覆蓋率新增至現有程式碼。在未經測試的模組中新增測試、為錯誤編寫回歸測試或使用者要求測試特定檔案時使用。處理mockReset:true、vi.hoisted()、轉發模式和測試應用程式建構器實用程式。 來源:acedergren/agentic-tools。
為搜尋與 AI 引用準備的穩定欄位與指令。
npx skills add https://github.com/acedergren/agentic-tools --skill write-tests使用正確的模擬模式將測試覆蓋率新增至現有程式碼。在未經測試的模組中新增測試、為錯誤編寫回歸測試或使用者要求測試特定檔案時使用。處理mockReset:true、vi.hoisted()、轉發模式和測試應用程式建構器實用程式。 來源:acedergren/agentic-tools。
開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/acedergren/agentic-tools --skill write-tests 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用
https://github.com/acedergren/agentic-tools