搜索插件、代码仓与 APP 分类

插件详情v2.0.2

test_descriptor

用于定义和验证文件及目录结构的 API。

AndroidiOSmacOSWindowsLinux
近 30 天下载
22.4万
喜欢数
4
Pub 分数
160

安装插件

flutter pub add test_descriptor

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

test_descriptor 是一个 Dart 包,旨在简化在测试过程中创建和验证文件及目录结构。它提供了一个清晰、简洁的 API 来定义预期的文件布局,使设置测试用例和验证文件系统状态变得更加容易。非常适合涉及文件操作的集成测试和端到端测试,能够确保一致性,并减少处理复杂目录层次时的样板代码。该包由 Dart 团队维护,并与测试框架无缝集成。

适合场景

  • 测试文件系统交互
  • 设置测试夹具
  • 验证目录结构
  • 验证生成的文件
  • 与文件 I/O 的集成测试
  • 自动化测试设置

主要特点

  • 声明式文件结构定义
  • 内置验证工具
  • 支持嵌套目录
  • 易于阅读和维护
  • 与 test 包兼容
  • 跨平台兼容性

适合对象

  • 单元测试和集成测试
  • 基于文件的工具测试
  • 代码生成验证
  • CI/CD 流水线测试
  • Dart 包开发
  • 测试夹具管理

使用建议

  • 需要依赖 test 包
  • 不适用于运行时使用
  • 仅限测试环境使用
  • 如果过度使用,可能会增加测试套件的复杂性
  • 最好与其他测试工具一起使用
  • 不直接处理文件内容差异

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

所属分类

依赖

依赖清单 5 项

源码仓库

使用此插件的项目