dart-generate-test-mocks 是做什麼的?
使用 package:mockito 和 build_runner 定義並生成外部依賴的模擬物件。適用於單元測試依賴複雜外部服務(如 API 或資料庫)的類別。
使用 `package:mockito` 和 `build_runner` 定義並生成外部依賴的模擬物件。適用於單元測試依賴複雜外部服務(如 API 或資料庫)的類別。
這個技能旨在簡化 Dart 專案中單元測試的模擬物件生成流程。它利用 `package:mockito` 的 annotations 和 `build_runner` 的程式碼生成能力,自動從真實類別介面建立模擬類別,省去手動編寫 mock 程式碼的繁瑣過程。開發者只需在測試中定義 mock 行為,即可隔離測試焦點類別,避免對 API、資料庫等外部服務的真實依賴。此技能特別適合在整合測試或複雜服務依賴的場景下使用,能提升測試的可維護性與執行速度。支援主流 Dart/Flutter 開發環境,並與現有測試框架(如 `test`)無縫整合。
npx skills add https://github.com/dart-lang/skills/tree/main/skills/dart-generate-test-mocksInstalled? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →
使用 package:mockito 和 build_runner 定義並生成外部依賴的模擬物件。適用於單元測試依賴複雜外部服務(如 API 或資料庫)的類別。
This repo contains 8 individual skills — each has its own dedicated page.
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free.
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.
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.