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

パッケージ詳細v0.1.5

spec_cli

Spec 用 CLI - Dart および Flutter 専用のスムーズなテストフレームワーク。

macOSWindowsLinux
30日間ダウンロード
108
いいね数
9
Pub ポイント
100

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

flutter pub add spec_cli

パッケージ概要

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

spec_cli は、Dart および Flutter アプリケーション向けに設計されたシンプルなテストフレームワークである Spec のためのコマンドラインインターフェースツールです。直感的なコマンドにより、テストの作成、実行、管理を簡単にします。invertase.io によって開発され、macOS、Windows、Linux をサポートしており、開発者が複数のプラットフォームで効率的にテストを実行できるようにしています。`flutter pub add spec_cli` による最小限のセットアップで、既存のワークフローにスムーズに統合できます。CLI はボイラープレートを減らし、テスト実行中の明確なフィードバックを提供することで生産性を向上させます。軽量な設計により、スピードと開発者の体験に焦点を当てています。

用途

  • CI/CDパイプラインでのテスト実行の自動化
  • テストファイルを素早く生成する
  • 最小構成でテストを実行しています
  • 既存のDart/Flutterプロジェクトとの統合
  • テストの発見とレポートの簡素化

主な機能

  • テスト管理用の簡単なCLIコマンド
  • クロスプラットフォーム対応(macOS、Windows、Linux)
  • Flutter および Dart とのシームレスな統合
  • 高速なテスト実行とフィードバック
  • 組み込みテストファイルの生成

適している対象

  • 効率的なテストを求めるDartおよびFlutter開発者
  • CI/CDワークフローを使用するチーム
  • テストに最小限のセットアップを望む開発者
  • テスト自動化の初心者
  • 開発者体験を最優先とするプロジェクト

注意事項

  • 完全な機能を使用するにはFlutter SDKが必要です
  • Spec テスティングフレームワークを使用するプロジェクトに限定
  • 複雑なテスト設定には追加の構成が必要になる場合があります
  • 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.

カテゴリー

依存関係

依存関係一覧 14 件

ソースリポジトリ

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

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