搜尋分類、套件與程式碼儲存庫

套件詳情v1.33.0

test

一個功能齊全的程式庫,用於在各個平台撰寫和執行 Dart 測試。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1410萬
喜歡數
629
Pub 分數
150

安裝套件

flutter pub add test

套件介紹

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

測試套件是一個完整的程式庫,可用於在多個平台(包括 Android、iOS、Web、macOS、Windows 和 Linux)上撰寫與執行 Dart 測試。它提供豐富的工具,支援單元測試、整合測試與 widget 測試,並支援非同步測試、模擬與測試報告。由 dart.dev 建立,可與 Flutter 及 Dart 工具鏈無縫整合,讓開發者能透過自動化測試工作流程維持高品質的程式碼。

適用情境

  • 單元測試 Dart 程式碼
  • 整合測試 Flutter 應用
  • Flutter 中的 Widget 測試
  • 跨平台測試執行
  • 自動化 CI/CD 測試
  • 在測試中模擬依賴項

主要特色

  • 支援 async 和 await 測試
  • 內建匹配器和期望
  • 測試隔離與設定/清除
  • 模擬框架整合
  • 詳細的測試報告
  • 跨平台相容性

適合對象

  • Flutter 開發者
  • Dart 庫作者
  • CI/CD 流水線整合者
  • 團隊正在實踐測試驅動開發
  • QA工程師自動化測試套件

使用建議

  • 需要理解 Dart 測試慣例
  • 可能需要額外的套件來實現複雜的模擬
  • 在大型項目中,測試設定可能會變得複雜
  • 不適用於終端使用者測試情境
  • 有限的GUI用於測試執行

原始 README

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

Dart CI OpenSSF Scorecard

What's here?

Welcome! package:test is the standard testing library for Dart and Flutter. If you have questions about Dart testing, please see the docs for package:test. package:test_api and package:test_core are implementation details and generally not user-facing.

package:checks is a relatively new library for expressing test expectations. It's a more modern version of package:matcher and features a literate API.

Packages

Package Description Issues Version
checks A framework for checking values against expectations and building custom expectations. issues pub package
fake_async Fake asynchronous events such as timers and microtasks for deterministic testing. issues pub package
matcher Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases. issues pub package
test A full featured library for writing and running Dart tests across platforms. issues pub package
test_api The user facing API for structuring Dart tests and checking expectations. pub package
test_core A basic library for writing tests and running them on the VM. pub package
test_descriptor An API for defining and verifying files and directory structures. issues pub package
test_process Test processes: starting; validating stdout and stderr; checking exit code. issues pub package

所屬分類

依賴

依賴清單 25 項

原始碼儲存庫

使用此套件的專案