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

套件詳情v0.3.2

checks

一個用於將值與預期進行比較並建立自訂預期的框架。

近 30 天下載
14.4萬
喜歡數
125
Pub 分數
160

安裝套件

flutter pub add checks

套件介紹

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

checks 套件是一個 Dart 框架,專門用於驗證值是否符合預期條件,讓開發者能夠建立自訂的斷言與驗證邏輯。它提供了一個彈性的基礎,允許定義可重複使用的期望規則,以撰寫表達力強、易讀的測試。此套件設計用於整合至測試工作流程,支援簡單的值檢查與複雜的領域特定驗證。在需要一致且可維護的斷言模式的測試套件中,此套件特別實用。

適用情境

  • 編寫自定義測試斷言
  • 在單元測試中驗證應用狀態
  • 建構可重用的驗證邏輯
  • 透過富有表現力的期望提升測試可讀性
  • 建立特定領域的檢查器

主要特色

  • 可擴展的期望系統
  • 支援自定檢查器定義
  • 與 Dart 測試生態系統的整合
  • 可讀且可鏈式呼叫的斷言語法
  • 模組化且可重用的檢查組件

適合對象

  • Dart 開發人員撰寫單元測試或整合測試
  • 需要在測試套件中保持一致驗證的團隊
  • 開發可重用測試工具的開發者

使用建議

  • 需要熟悉 Dart 的測試框架
  • 最佳使用環境為測試環境
  • 不適用於生產程式碼中的執行時間驗證
  • 有限的獨立實用程式,超出測試環境

原始 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

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案

所在榜單