搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.0

full_coverage

一個套件腳本,用於讓覆蓋率測試工具能夠看見所有Dart檔案。

AndroidiOSmacOSWindowsLinux
近 30 天下載
1.2萬
喜歡數
24
Pub 分數
155

安裝套件

flutter pub add full_coverage

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

full_coverage 套件是一個腳本工具,旨在確保覆蓋率測試工具能夠偵測並分析 Flutter 專案中的所有 Dart 檔案。它解決了測試執行器發現來源檔案時,某些檔案被排除在覆蓋率報告之外的常見問題。透過整合此套件,開發者可以獲得整個程式碼庫中更準確的程式碼覆蓋率指標,進而提升測試的可靠性。它支援多個平台,包括 Android、iOS、macOS、Windows 和 Linux。

適用情境

  • 確保 CI/CD 流水線中的完整程式碼覆蓋率
  • 提高測試報告的準確性
  • 除錯特定檔案遺失的覆蓋率
  • 支援完整的測試工作流程
  • 與覆蓋率分析工具整合

主要特色

  • 自動包含所有 Dart 檔案以進行覆蓋率掃描
  • 透過 Flutter pub add 簡單整合
  • 跨平台相容性
  • 提升未測試程式碼的可見性
  • 可與現有的測試套件無縫配合

適合對象

  • 專注於高測試覆蓋率的Flutter團隊
  • CI/CD 環境需要可靠的覆蓋率數據
  • 開發者排錯覆蓋範圍缺口
  • 使用覆蓋率工具(如 `coverage` 或 `dart test --coverage`)的專案
  • 致力於符合測試標準的團隊

使用建議

  • 測試腳本中需要正確配置
  • 如果使用自定檔案發現,可能需要進行調整
  • 不是獨立的測試工具,而是補充
  • 最佳搭配結構化測試實踐使用
  • 不產生測試——僅提高覆蓋率可見性

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

full_coverage

Coverage tools like codecov only see the files that were actually triggered by tests. This means that a coverage of 100% can easily be a lie, e.g. you can just write a dummy test that does not import any files and a coverage tool will ignore all the code base.

Luckily, this package resolves this problem.

How it works

The full_coverage package harvests the power of Bash to find all files in specified directory, by default it is lib directory, where all Flutter files are. It then creates a dummy test file test/full_coverage_test.dart that imports all the Dart files that were found and has an empty void main() {} function so that it actually starts.

Install

Use this command:

dart pub global activate full_coverage

Execute

Use the command:

dart pub global run full_coverage

Or add the cache-system to your PATH environment variable for run directly. Check documentation for more;

full_coverage

Other commands

-i, --ignore       Ignore files. ex (*_widget.dart,*_page.dart).
-h, --[no-]help    usage doc.

For more details Telegram Group Flutterando.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案