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

插件详情v0.2.0

given_when_then

一个 Flutter 包,可在实现代码复用的同时使测试更具可读性。

AndroidiOSmacOSWindowsLinux
近 30 天下载
34
喜欢数
14
Pub 分数
150

安装插件

flutter pub add given_when_then

插件介绍

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

一个 Flutter 测试包,通过结构化的 'Given-When-Then' 语法增强测试的可读性并促进代码复用。它允许开发者通过分离设置(Given)、操作(When)和预期(Then)阶段来清晰地定义测试场景。这种方法提高了单元测试和 widget 测试的可维护性和清晰度,尤其是在复杂或重复的测试用例中。该包专为重视简洁、表达性强的测试代码的团队设计,并能与现有的 Flutter 测试框架无缝集成。

适合场景

  • 编写可读的单元测试
  • 提高小部件测试的清晰度
  • 重用测试设置逻辑
  • 创建可维护的测试套件
  • 减少测试文件中的样板代码

主要特点

  • 结构化的 '给定-当-则' 测试组织
  • 对可重用测试步骤的支持
  • 最小的 API 开销
  • 与 Flutter 的测试生态系统兼容
  • 鼓励使用 DRY 测试模式

适合对象

  • 测试驱动开发团队
  • 大规模 Flutter 项目
  • 专注于测试可维护性的团队
  • 编写复杂集成测试的开发者
  • 任何希望测试代码更简洁的人

使用建议

  • 需要理解 BDD 风格的测试
  • 最好与其他测试工具(如 mockito)一起使用
  • 不是核心测试框架的替代品
  • 仅限测试环境使用
  • 新用户可能需要稍微适应一下学习曲线

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter Glove Box

This repo is no longer maintained

09/12/2024 Update:

Unfortunately we have made the tough decision to no longer actively maintain this repository. While the package has served us and the community well, we don't have the capacity to give it the attention it deserves.

We realize that this decision means that open pull requests will not be merged. Our hope is that the community will rally and focus their efforts around more actively maintained packages for aiding in golden-based tests.

Once again, we want to thank each and every one of you for your contributions over the years.

Thank you for your understanding.

Best regards,

The eBay Motors App team


Contains various testing tools that eBay Motors App team is using in their development on daily basis.

License Information

Copyright 2019-2023 eBay Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of eBay Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。