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

パッケージ詳細v1.3.3

fake_async

決定論的テスト用の仮想的な非同期イベント(タイマー、マイクロタスクなど)。

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

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

flutter pub add fake_async

パッケージ概要

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

fake_async は、非同期コードの決定論的テストに特化したDartパッケージです。開発者がタイマー、マイクロタスク、その他の非同期イベントを制御された環境でシミュレートできるようにし、テスト結果が予測可能かつ再現可能になるようにします。非同期動作をフェイクすることで、実時間の遅延に依存しなくなり、テストが高速かつ信頼性が高くなります。Futureやストリーム、スケジュールされたタスクを含む非同期処理を含むユニットテストや統合テストに最適です。

用途

  • 実際の遅延を使わずに非同期コードをテストする
  • タイマーとマイクロタスクのシミュレーション
  • 決定論的ユニットテストの作成
  • ストリームおよび将来の論理の検証
  • テストパフォーマンスの向上

主な機能

  • 非同期操作のタイミングを制御する
  • マイクロタスクおよびタイマーのフェイクをサポート
  • 正確なテスト実行を有効にします
  • テストパッケージと統合されます
  • 非同期モック用のクリーンなAPIを提供します

適している対象

  • Dart開発者がユニットテストを書いている
  • テストの信頼性を最優先にするチーム
  • 複雑な非同期ワークフローを備えたプロジェクト
  • テスト駆動開発の実践
  • 高速テストを必要とするCI/CDパイプライン

注意事項

  • エンドツーエンドテストには適していません
  • イベントループの理解が必要です
  • テスト環境に限定
  • 本番環境では実際の非同期動作を置き換えるものではありません
  • テストファイルに適切な設定が必要です

元の 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

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

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