dart-add-unit-test 是做什麼的?
使用 package:test 撰寫與組織函式、方法及類別的單元測試。在建立新邏輯或修復錯誤時使用,以確保程式碼正確無誤且無回歸問題。
使用 `package:test` 編寫與組織函式、方法及類別的單元測試。在建立新邏輯或修復錯誤時使用,以確保程式碼正確無誤且無回歸問題。
此技能專為 Dart 語言開發,協助開發者使用官方套件 `package:test` 來撰寫與組織單元測試。它適用於任何 Dart 專案(包括 Flutter 應用程式、伺服器端程式及套件),特別是在建立新邏輯或修復錯誤時,能有效確保程式碼的正確性並防止回歸問題。技能會根據使用者提供的函式、方法或類別,自動產生對應的測試結構與範例測試案例,涵蓋邊界條件與典型使用情境。它支援常見的測試平台(如 Dart VM 與 Flutter),並遵循 Dart 測試慣例,例如使用 `test()` 與 `group()` 函式來組織測試。透過此技能,開發者可以快速建立測試基礎,減少手動撰寫樣板程式碼的時間,提升程式碼品質與維護性。
npx skills add https://github.com/dart-lang/skills/tree/main/skills/dart-add-unit-testInstalled? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →
使用 package:test 撰寫與組織函式、方法及類別的單元測試。在建立新邏輯或修復錯誤時使用,以確保程式碼正確無誤且無回歸問題。
This repo contains 8 individual skills — each has its own dedicated page.
Entrypoint structure, exit codes, cross-platform scripts. Use when building command line utilities, scripts, or applications.
Collect coverage using the coverage packge and create an LCOV report
Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing classes that depend on complex external services like APIs or databases.
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.
Execute `dart analyze` to identify warnings and errors, and use `dart fix --apply` to automatically resolve mechanical lint issues. Use during development to ensure code quality and before committing changes.
Use switch expressions and pattern matching where appropriate
Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.
Control Eight Sleep pods (status, temperature, alarms, schedules).
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Create, search, and manage Bear notes via grizzly CLI.
Capture frames or clips from RTSP/ONVIF cameras.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.