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

插件详情v2.1.1

test_process

测试流程:启动;验证 stdout 和 stderr;检查退出代码

AndroidiOSmacOSWindowsLinux
近 30 天下载
11.2万
喜欢数
12
Pub 分数
70

安装插件

flutter pub add test_process

插件介绍

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

test_process 包为在 Dart 应用程序中测试命令行进程提供实用工具。它使开发者能够启动外部进程,捕获其 stdout 和 stderr 输出,并验证退出代码,非常适合用于 CLI 工具的集成测试和端到端测试。该包专为与 Dart 测试框架无缝协作而设计,可在多个平台上提供可靠的进程管理。它支持在 Android、iOS、macOS、Windows 和 Linux 上进行跨平台测试,确保在各种环境中的行为一致。

适合场景

  • 测试 CLI 工具行为
  • 验证过程输出
  • 验证退出代码
  • 跨平台集成测试
  • 测试中的自动化命令执行

主要特点

  • 启动和管理外部进程
  • 捕获 stdout 和 stderr
  • 检查退出代码
  • 跨平台兼容性
  • 与 Dart 测试框架的集成

适合对象

  • CLI 应用开发者
  • 测试自动化工程师
  • 跨平台测试
  • Shell 命令的端到端测试
  • 使用 test 包的 Dart 项目

使用建议

  • 需要 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

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目