パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.2.1

dart_test_adapter

`dart test`/`flutter test` とプログラム的にやり取りするための Dart API を提供します

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
443
いいね数
7
Pub ポイント
130

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

flutter pub add dart_test_adapter

パッケージ概要

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

dart_test_adapter パッケージは、`dart test` および `flutter test` コマンドとプログラム的にやり取りするための Dart API を提供します。開発者がテストを実行し、結果を解析し、Dart アプリケーション内でテスト実行を管理できるようにし、カスタムツールや CI/CD パイプラインにテストワークフローを統合するのに最適です。Android、iOS、macOS、Windows、Linux の開発環境で使用することを想定しており、シェルスクリプトに依存せずにテスト実行をシームレスに自動化・制御できるようになっています。このパッケージは invertase.io によって維持されており、オープンソースです。

用途

  • CI/CDパイプラインでのテスト実行の自動化
  • カスタム開発ツールへのテストランナーの統合
  • プログラムによるテスト結果の分析
  • Dart アプリケーション内からテストを実行する
  • 動的テスト構成の有効化

主な機能

  • テストランナーへのプログラム的アクセス
  • クロスプラットフォーム対応
  • Flutter および Dart テストフレームワークとの統合
  • リアルタイム結果のパース
  • オープンソースで、積極的にメンテナンスされています

適している対象

  • CI/CDオートメーションエンジニア
  • テストフレームワーク開発者
  • ツール作成者
  • Dart/Flutter アプリケーションのメンテナス

注意事項

  • テスト環境の適切な設定が必要です
  • 複雑なテストスイートには追加のエラーハンドリングが必要になる可能性があります
  • エンドユーザーによる直接的なテスト実行を想定していません
  • アプリケーションロジックではなく、バックエンドまたはツールコンテキストで最も適しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

✅ Spec

A streamlined testing framework for Dart & Flutter.

Melos docs.page Chat on Discord

What is it?

Spec builds on-top of existing Dart & Flutter testing tools to provide a streamlined & elegant testing environment. Spec provides both a CLI tool and Dart package.

CLI

The Spec CLI allows you to run the spec command from your CLI environment and run your tests:

  • Intuitive testing output interface, inspired by Jest.
  • Interactive CLI (via spec --watch); automatically re-run tests when source code changes & rerunning of only failed tests.
  • Run both Dart & Flutter tests in parallel with a single command.
  • Run tests from multiple packages at the same time using Melos.

spec

Package

The spec package provides a different take on how to write tests. Designed with type-safety and IDE autocompletion in mind, spec alters the way you write your tests to be more declarative, less error prone and force good habits.

Getting Started

Matchers

Spec CLI works alongside normal Dart test matchers, however also ships with custom matchers, see the API reference docs.

Example of testing using Spec matchers:

import 'package:spec/spec.dart';

void main() {
  test('future example', () async {
    final future = Future.value(42);
    expect(future).toEqual(future);
    await expect(future).completion.toEqual(42);
    await expect(future).throws.isArgumentError();
  });

  test('stream example', () async {
    final stream = Stream.value(42);
    await expect(stream).emits.toEqual(42);
    await expect(stream).emits.isNull();
    await expect(stream).emits.not.isNull();
    await expect(stream).emitsError.isArgumentError();
  });

  test('function example', () {
    void throwsFn() => throw Error();
    expect(throwsFn).returnsNormally();
    expect(throwsFn).throws.isArgumentError();
  });
}
CLI
Installation
dart pub global activate spec_cli
Usage

Run tests:

spec

Run tests in interactive mode:

spec --watch

Interactive mode supports a number of keyboard shortcuts:

Watch Usage:
 › Press f to run only failed tests.
 › Press t to filter by a test name regex pattern.
 › Press q to quit watch mode.
 › Press Enter to trigger a test run.
GitHub Action

If you want to use Spec in your GitHub actions pipeline you can utilize the Spec GitHub action, instructions for how to use it can be found on the the spec-action's marketplace page and in its repository.


LICENSE

Built and maintained by Invertase.

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

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

データはまだありません。