搜索分类、插件与代码仓

插件详情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 项

源码仓库

使用此插件的项目

所在榜单