カテゴリー・パッケージ・リポジトリを検索

パッケージ詳細v0.12.20

matcher

拡張可能な Matcher クラスを介してテストの期待値を指定する機能をサポートしています。また、一般的なケース用の多数の組み込み Matcher 実装も含まれています。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1330万
いいね数
68
Pub ポイント
150

パッケージをインストール

flutter pub add matcher

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

matcher パッケージは、Dart でテストの期待を定義するための柔軟かつ拡張可能なフレームワークを提供します。等価性、型チェック、コレクション比較などの一般的なアサーションに使用できる豊富な組み込みマッチャーが含まれています。開発者は、複雑な検証ロジックを明確かつ簡潔に表現するためにカスタムマッチャーを作成することもできます。このパッケージは、Dart テスティングエコシステムを使用して読みやすく保守しやすいテストを書くために不可欠です。

用途

  • 明確なアサーションを持つユニットテストの書き方
  • 複雑なオブジェクト構造の検証
  • 再利用可能なテスト条件の作成
  • コレクションとネストされたデータのテスト
  • カスタムロジックでテストの期待を拡張する

主な機能

  • 拡張可能なマッチャークラス
  • 一般的なケース用の組み込みマッチャー
  • カスタムマッチャーの作成をサポート
  • 失敗時の明確なエラーメッセージ
  • Dart テストフレームワークとの統合

適している対象

  • Dart開発者がユニットテストと統合テストを書いている
  • 読みやすいテストコードを重視するチーム
  • `test` パッケージを使用するプロジェクト
  • 表現力のあるアサーション構文が必要な開発者
  • テストユーティリティやフレームワークを構築している人

注意事項

  • 完全な機能を実現するには `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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト