Spec - A streamlined testing framework for Dart & Flutter

Overview

Spec

A streamlined testing framework for Dart & Flutter.

Melos docs.page

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.

LICENSE

Built and maintained by Invertase.

Comments
  • Unable to install `spec_cli`

    Unable to install `spec_cli`

    I'm unable to install the spec_cli. #32 fixed the Riverpod 2 problem. However, it's still not possible to install spec_cli.

    Running dart pub global activate spec_cli prints this output:

    Output
    + _fe_analyzer_shared 49.0.0.3s)
    + analyzer 5.1.0
    + ansi_styles 0.3.2+1
    + args 2.3.1
    + async 2.9.0
    + boolean_selector 2.1.0
    + charcode 1.3.1
    + cli_util 0.3.5
    + collection 1.16.0
    + conventional_commit 0.4.3+1 (0.5.0 available)
    + convert 3.0.2
    + coverage 1.6.1
    + crypto 3.0.2
    + dart_test_adapter 0.2.0
    + duration 3.0.12
    + file 6.1.4
    + freezed_annotation 1.1.0 (2.1.0 available)
    + frontend_server_client 3.0.0
    + glob 2.1.0
    + graphs 2.1.0
    + http 0.13.5
    + http_multi_server 3.2.1
    + http_parser 4.0.1
    + io 1.0.3
    + js 0.6.4
    + json_annotation 4.7.0
    + logging 1.1.0
    + matcher 0.12.12
    + melos 1.5.2 (2.7.1 available)
    + meta 1.8.0
    + mime 1.0.2
    + mustache_template 2.0.0
    + node_preamble 2.0.1
    + package_config 2.1.0
    + path 1.8.2
    + platform 3.1.0
    + pool 1.5.1
    + pub_semver 2.1.1
    + pubspec 2.3.0
    + quiver 3.1.0
    + riverpod 2.0.2
    + shelf 1.4.0
    + shelf_packages_handler 3.0.1
    + shelf_static 1.1.1
    + shelf_web_socket 1.0.2
    + source_map_stack_trace 2.1.0
    + source_maps 0.10.10
    + source_span 1.9.1
    + spec_cli 0.1.2+2 (0.1.3 available)
    + stack_trace 1.10.0
    + state_notifier 0.7.2+1
    + stream_channel 2.1.1
    + string_scanner 1.1.1
    + term_glyph 1.2.1
    + test 1.21.6
    + test_api 0.4.14
    + test_core 0.4.18
    + typed_data 1.3.1
    + uri 1.0.0
    + vm_service 9.4.0
    + watcher 1.0.1
    + web_socket_channel 2.2.0
    + webkit_inspection_protocol 1.2.0
    + yaml 3.1.1
    Downloading logging 1.1.0...
    Building package executables... (1.4s)
    Failed to build spec_cli:main:
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:148:31: Error: The argument type 'AlwaysAliveRefreshable<StateController<RegExp?>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'RegExp' is from 'dart:core'.
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
        ref.read($testNameFilters.notifier).state = options.testNameFilters.isEmpty
                                  ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:153:31: Error: The argument type 'AlwaysAliveRefreshable<StateController<List<String>>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'List' is from 'dart:core'.
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
        ref.read($filePathFilters.notifier).state = options.fileFilters
                                  ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:157:27: Error: The argument type 'AlwaysAliveRefreshable<StateController<bool>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
        ref.read($isWatchMode.notifier).state = options.watch;
                              ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:158:25: Error: The argument type 'AlwaysAliveRefreshable<StateController<DateTime>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'DateTime' is from 'dart:core'.
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
        ref.read($startTime.notifier).state = DateTime.now();
                            ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:177:57: Error: The argument type 'AlwaysAliveRefreshable<StateController<List<FailedTestLocation>>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'List' is from 'dart:core'.
     - 'FailedTestLocation' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
                data: (value) => ref.read(_$lastFailedTests.notifier).state = value,
                                                            ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:178:55: Error: The argument type 'AlwaysAliveRefreshable<StateController<List<FailedTestLocation>>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'List' is from 'dart:core'.
     - 'FailedTestLocation' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
                loading: () => ref.read(_$lastFailedTests.notifier).state = [],
                                                          ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:180:53: Warning: Operand of null-aware operation '!' has type 'StackTrace' which excludes null.
     - 'StackTrace' is from 'dart:core'.
                  Zone.current.handleUncaughtError(err, stack!);
                                                        ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:209:53: Warning: Operand of null-aware operation '!' has type 'StackTrace' which excludes null.
     - 'StackTrace' is from 'dart:core'.
                  Zone.current.handleUncaughtError(err, stack!);
                                                        ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:231:30: Error: The getter 'future' isn't defined for the class 'AutoDisposeProvider<AsyncValue<int>>'.
     - 'AutoDisposeProvider' is from 'package:riverpod/src/provider.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/provider.dart').
     - 'AsyncValue' is from 'package:riverpod/src/common.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/common.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'future'.
            ref.listen($exitCode.future, (previous, current) {});
                                 ^^^^^^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:234:41: Error: The getter 'future' isn't defined for the class 'AutoDisposeProvider<AsyncValue<int>>'.
     - 'AutoDisposeProvider' is from 'package:riverpod/src/provider.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/provider.dart').
     - 'AsyncValue' is from 'package:riverpod/src/common.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/common.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'future'.
            return await ref.read($exitCode.future);
                                            ^^^^^^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:254:43: Error: The argument type 'Refreshable<StateController<bool>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'Refreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($isEditingTestNameFilter.notifier).state = false;
                                              ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:255:35: Error: The argument type 'AlwaysAliveRefreshable<StateController<RegExp?>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'RegExp' is from 'dart:core'.
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($testNameFilters.notifier).state =
                                      ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:263:43: Error: The argument type 'Refreshable<StateController<bool>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'Refreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($isEditingTestNameFilter.notifier).state = false;
                                              ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:267:44: Error: The argument type 'Refreshable<StateController<String>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'Refreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($editingTestNameTextField.notifier).update((state) {
                                               ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:272:44: Error: The argument type 'Refreshable<StateController<String>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'Refreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($editingTestNameTextField.notifier).state +=
                                               ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:283:29: Error: The argument type 'AlwaysAliveRefreshable<StateController<bool>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($didPressQ.notifier).state = true;
                                ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:288:34: Error: The argument type 'Refreshable<StateController<bool>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'Refreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($showWatchUsage.notifier).state = true;
                                     ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:293:45: Error: The argument type 'AlwaysAliveRefreshable<StateController<bool>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($isRunningOnlyFailingTests.notifier).update((state) => !state);
                                                ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:299:44: Error: The argument type 'Refreshable<StateController<String>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'Refreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($editingTestNameTextField.notifier).state =
                                               ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:301:43: Error: The argument type 'Refreshable<StateController<bool>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'Refreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
            ref.read($isEditingTestNameFilter.notifier).state = true;
                                              ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:312:28: Error: The argument type 'AlwaysAliveRefreshable<TestEventsNotifier>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'TestEventsNotifier' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
              ref.read($events.notifier).stop();
                               ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:324:23: Error: The argument type 'AlwaysAliveRefreshable<StateController<DateTime>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'DateTime' is from 'dart:core'.
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
      ref.read($startTime.notifier).state = DateTime.now();
                          ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/command_runner.dart:325:41: Error: The argument type 'AlwaysAliveRefreshable<StateController<List<FailedTestLocation>?>>' can't be assigned to the parameter type 'ProviderBase<dynamic>'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'StateController' is from 'package:riverpod/src/state_controller.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/state_controller.dart').
     - 'List' is from 'dart:core'.
     - 'FailedTestLocation' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderBase' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
      ref.read($failedTestLocationToExecute.notifier).state =
                                            ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart:31:23: Error: A value of type 'AlwaysAliveRefreshable<Future<List<_Package>>>' can't be assigned to a variable of type 'ProviderOrFamily'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'Future' is from 'dart:async'.
     - 'List' is from 'dart:core'.
     - '_Package' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderOrFamily' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
        $filteredPackages.future,
                          ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart:224:31: Error: A value of type 'AlwaysAliveRefreshable<Future<List<_Package>>>' can't be assigned to a variable of type 'ProviderOrFamily'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'Future' is from 'dart:async'.
     - 'List' is from 'dart:core'.
     - '_Package' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderOrFamily' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
      dependencies: [$allPackages.future, $filePathFilters],
                                  ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/rendering.dart:405:27: Error: A value of type 'AlwaysAliveRefreshable<TestEventsNotifier>' can't be assigned to a variable of type 'ProviderOrFamily'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'TestEventsNotifier' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderOrFamily' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
    }, dependencies: [$events.notifier]);
                              ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/rendering.dart:412:27: Error: A value of type 'AlwaysAliveRefreshable<TestEventsNotifier>' can't be assigned to a variable of type 'ProviderOrFamily'.
     - 'AlwaysAliveRefreshable' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
     - 'TestEventsNotifier' is from 'package:spec_cli/src/dart_test.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/dart_test.dart').
     - 'ProviderOrFamily' is from 'package:riverpod/src/framework.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/framework.dart').
    }, dependencies: [$events.notifier]);
                              ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/provider_utils.dart:17:22: Error: Too few positional arguments: 2 required, 1 given.
        return AsyncError(e.error, stackTrace: e.stackTrace);
                         ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/common.dart:372:9: Context: Found this candidate, but the arguments don't match.
      const AsyncError(Object error, StackTrace stackTrace)
            ^^^^^^^^^^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/spec_cli-0.1.2+2/lib/src/provider_utils.dart:21:25: Error: Too few positional arguments: 2 required, 1 given.
        return AsyncError<T>(err, stackTrace: stack);
                            ^
    ../../../../../.pub-cache/hosted/pub.dartlang.org/riverpod-2.0.2/lib/src/common.dart:372:9: Context: Found this candidate, but the arguments don't match.
      const AsyncError(Object error, StackTrace stackTrace)
            ^^^^^^^^^^
    

    Pub knows that there is the version 0.1.3 of spec_cli but is unable to install it because it depends on other depenceny. I think this problem is releated to the problem (low score) on pub.dev:

    image image

    https://pub.dev/packages/spec_cli/score

    The output is:

    Because spec_cli depends on dart_test_adapter ^0.2.0 which depends on freezed_annotation ^1.1.0, freezed_annotation ^1.1.0 is required.
    So, because spec_cli depends on freezed_annotation ^2.1.0, version solving failed.
    
    opened by nilsreichardt 4
  • feat: List and map matchers

    feat: List and map matchers

    That PR has covered few matchers from #3

    List

    • [expect.listContaining(List)] named: containsAll(List<Param>)

    • [expect.not.listContaining(List)] not matcher exists. I've added test to not.containsAll()

    • [.toContain(item)] named: contains(Param)

    Map

    • [.toHaveProperty(path, value?)] split into: containsPair(KeyParam, ValueParam) and containsKey(KeyParam)
    opened by trejdych 4
  • spec_cli pulls in breaking changes from riverpod

    spec_cli pulls in breaking changes from riverpod

    Package spec_cli is failing due to breaking changes from riverpod 2.0.0. This seems to be causing Flame engine's github workflows to fail. Here is a log: https://github.com/flame-engine/flame/actions/runs/3163297130/jobs/5150721652

    opened by ufrshubham 3
  • Testing all packages in a melos project

    Testing all packages in a melos project

    Hi,

    I have a melos project with a number of packages, and I like to watch all of them at once.

    What's the best way to go about this? I currently have a melos script execute spec --watch in each package, and this works pretty well, with the limitation that I'm not able to interact with any of the watchers.

    Is there a way I can watch all the packages in a melos project while retaining the interactive functionality offered by spec?

    Thanks

    opened by ryanhanks-bestow 3
  • Error Running spec

    Error Running spec

    First of all thanks for this wonderful package.

    Description

    I'm getting this error when running spec.

    Error logs:

    divyanshubhargava@ARE-Divyanshu-Bhargava mobile_app % spec
    Building package executable... 
    Failed to build spec_cli:main:
    .pub-cache/hosted/pub.dartlang.org/riverpod-2.0.0-dev.3/lib/src/framework/provider_base.dart:904:9: Error: Member not found: 'Error.throwWithStackTrace'.
      Error.throwWithStackTrace(error, chain);
            ^^^^^^^^^^^^^^^^^^^
    .pub-cache/hosted/pub.dartlang.org/riverpod-2.0.0-dev.3/lib/src/framework/provider_base.dart:898:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
    Never _rethrowProviderError(Object error, StackTrace stackTrace) {
          ^
    
    

    Flutter Doctor

    divyanshubhargava@ARE-Divyanshu-Bhargava mobile_wisdom_tree % flutter doctor -v
    [✓] Flutter (Channel stable, 2.8.1, on macOS 12.2 21D49 darwin-x64, locale en-AE)
        • Flutter version 2.8.1 at /Users/divyanshubhargava/softwares/flutter/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 77d935af4d (10 weeks ago), 2021-12-16 08:37:33 -0800
        • Engine revision 890a5fca2e
        • Dart version 2.15.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/divyanshubhargava/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.2
    
    [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
        ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    
    [✓] Android Studio (version 2021.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    
    [✓] Connected device (1 available)
        • Pixel 6 (mobile) • 18201FDF6000LN • android-arm64 • Android 12 (API 31)
    
    ! Doctor found issues in 1 category.
    divyanshubhargava@ARE-Divyanshu-Bhargava mobile_wisdom_tree % 
    
    
    opened by divyanshub024 3
  • Cannot build spec_cli

    Cannot build spec_cli

    Looks like the generated dart code was not checked in prior to publishing the cli.

    When running dart pub global activate spec_cli I encounter the following exception:

    $ dart pub global activate spec_cli  
    
    Resolving dependencies... (1.0s)
    + _fe_analyzer_shared 34.0.0
    + analyzer 3.2.0
    + ansi_styles 0.3.1
    + args 2.3.0
    + async 2.8.2
    + boolean_selector 2.1.0
    + charcode 1.3.1
    + cli_util 0.3.5
    + collection 1.15.0
    + conventional_commit 0.4.2
    + convert 3.0.1
    + coverage 1.1.0
    + crypto 3.0.1
    + dart_test_adapter 0.1.0
    + duration 3.0.8
    + file 6.1.2
    + freezed_annotation 1.1.0
    + frontend_server_client 2.1.2
    + glob 2.0.2
    + graphs 2.1.0
    + http 0.13.4
    + http_multi_server 3.0.1
    + http_parser 4.0.0
    + io 1.0.3
    + js 0.6.3 (0.6.4 available)
    + json_annotation 4.4.0
    + logging 1.0.2
    + matcher 0.12.11
    + melos 1.2.0
    + meta 1.7.0
    + mime 1.0.1
    + mustache_template 2.0.0
    + node_preamble 2.0.1
    + package_config 2.0.2
    + path 1.8.1
    + platform 3.1.0
    + pool 1.5.0
    + pub_semver 2.1.0
    + pubspec 2.0.1
    + quiver 3.0.1+1
    + riverpod 2.0.0-dev.0
    + shelf 1.2.0
    + shelf_packages_handler 3.0.0
    + shelf_static 1.1.0
    + shelf_web_socket 1.0.1
    + source_map_stack_trace 2.1.0
    + source_maps 0.10.10
    + source_span 1.8.2
    + spec_cli 0.1.0
    + stack_trace 1.10.0
    + state_notifier 0.7.2+1
    + stream_channel 2.1.0
    + string_scanner 1.1.0
    + term_glyph 1.2.0
    + test 1.20.1
    + test_api 0.4.9
    + test_core 0.4.11
    + typed_data 1.3.0
    + uri 1.0.0
    + vm_service 8.1.0
    + watcher 1.0.1
    + web_socket_channel 2.1.0
    + webkit_inspection_protocol 1.0.0
    + yaml 3.1.0
    Building package executables... (1.9s)
    Failed to build spec_cli:main:
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart:3:6: Error: Error when reading '../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.g.dart': No such file or directory
    part 'test_protocol.g.dart';
         ^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart:3:6: Error: Can't use '../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.g.dart' as a part, because it has no 'part of' declaration.
    part 'test_protocol.g.dart';
         ^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:385:7: Error: Method not found: '_$$TestEventStartFromJson'.
          _$$TestEventStartFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:576:12: Error: The method '_$$TestEventStartToJson' isn't defined for the class '_$TestEventStart'.
     - '_$TestEventStart' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventStartToJson'.
        return _$$TestEventStartToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:646:7: Error: Method not found: '_$$TestEventDoneFromJson'.
          _$$TestEventDoneFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:832:12: Error: The method '_$$TestEventDoneToJson' isn't defined for the class '_$TestEventDone'.
     - '_$TestEventDone' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventDoneToJson'.
        return _$$TestEventDoneToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:902:7: Error: Method not found: '_$$TestEventAllSuitesFromJson'.
          _$$TestEventAllSuitesFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1083:12: Error: The method '_$$TestEventAllSuitesToJson' isn't defined for the class '_$TestEventAllSuites'.
     - '_$TestEventAllSuites' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventAllSuitesToJson'.
        return _$$TestEventAllSuitesToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1157:7: Error: Method not found: '_$$TestEventSuiteFromJson'.
          _$$TestEventSuiteFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1338:12: Error: The method '_$$TestEventSuiteToJson' isn't defined for the class '_$TestEventSuite'.
     - '_$TestEventSuite' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventSuiteToJson'.
        return _$$TestEventSuiteToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1411:7: Error: Method not found: '_$$TestEventGroupFromJson'.
          _$$TestEventGroupFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1592:12: Error: The method '_$$TestEventGroupToJson' isn't defined for the class '_$TestEventGroup'.
     - '_$TestEventGroup' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventGroupToJson'.
        return _$$TestEventGroupToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1666:7: Error: Method not found: '_$$TestEventTestStartFromJson'.
          _$$TestEventTestStartFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1847:12: Error: The method '_$$TestEventTestStartToJson' isn't defined for the class '_$TestEventTestStart'.
     - '_$TestEventTestStart' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventTestStartToJson'.
        return _$$TestEventTestStartToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:1935:7: Error: Method not found: '_$$TestEventTestDoneFromJson'.
          _$$TestEventTestDoneFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:2128:12: Error: The method '_$$TestEventTestDoneToJson' isn't defined for the class '_$TestEventTestDone'.
     - '_$TestEventTestDone' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventTestDoneToJson'.
        return _$$TestEventTestDoneToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:2215:7: Error: Method not found: '_$$TestEventMessageFromJson'.
          _$$TestEventMessageFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:2405:12: Error: The method '_$$TestEventMessageToJson' isn't defined for the class '_$TestEventMessage'.
     - '_$TestEventMessage' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventMessageToJson'.
        return _$$TestEventMessageToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:2498:7: Error: Method not found: '_$$TestEventTestErrorFromJson'.
          _$$TestEventTestErrorFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:2692:12: Error: The method '_$$TestEventTestErrorToJson' isn't defined for the class '_$TestEventTestError'.
     - '_$TestEventTestError' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventTestErrorToJson'.
        return _$$TestEventTestErrorToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:2780:7: Error: Method not found: '_$$TestEventDebugFromJson'.
          _$$TestEventDebugFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:2971:12: Error: The method '_$$TestEventDebugToJson' isn't defined for the class '_$TestEventDebug'.
     - '_$TestEventDebug' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventDebugToJson'.
        return _$$TestEventDebugToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:3036:7: Error: Method not found: '_$$TestEventUnknownFromJson'.
          _$$TestEventUnknownFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:3212:12: Error: The method '_$$TestEventUnknownToJson' isn't defined for the class '_$TestEventUnknown'.
     - '_$TestEventUnknown' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$TestEventUnknownToJson'.
        return _$$TestEventUnknownToJson(this);
               ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:3533:58: Error: Method not found: '_$$_TestFromJson'.
      factory _$_Test.fromJson(Map<String, dynamic> json) => _$$_TestFromJson(json);
                                                             ^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:3638:12: Error: The method '_$$_TestToJson' isn't defined for the class '_$_Test'.
     - '_$_Test' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$_TestToJson'.
        return _$$_TestToJson(this);
               ^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:3843:7: Error: Method not found: '_$$_SuiteFromJson'.
          _$$_SuiteFromJson(json);
          ^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:3887:12: Error: The method '_$$_SuiteToJson' isn't defined for the class '_$_Suite'.
     - '_$_Suite' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$_SuiteToJson'.
        return _$$_SuiteToJson(this);
               ^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:4170:7: Error: Method not found: '_$$_GroupFromJson'.
          _$$_GroupFromJson(json);
          ^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:4250:12: Error: The method '_$$_GroupToJson' isn't defined for the class '_$_Group'.
     - '_$_Group' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$_GroupToJson'.
        return _$$_GroupToJson(this);
               ^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:4419:7: Error: Method not found: '_$$_MetadataFromJson'.
          _$$_MetadataFromJson(json);
          ^^^^^^^^^^^^^^^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.freezed.dart:4456:12: Error: The method '_$$_MetadataToJson' isn't defined for the class '_$_Metadata'.
     - '_$_Metadata' is from 'package:dart_test_adapter/src/test_protocol.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/dart_test_adapter-0.1.0/lib/src/test_protocol.dart').
    Try correcting the name to the name of an existing method, or defining a method named '_$$_MetadataToJson'.
        return _$$_MetadataToJson(this);
    
    opened by felangel 3
  • docs: Add issues templates and pr templates.

    docs: Add issues templates and pr templates.

    Description

    It would be nice to have a template for raising new issues and also for the pull requests so that it'll be structured and easy for folks contributing to this project.

    Solution

    I would like to add the templates for issues and the pull request.

    opened by shashankbhatgs 2
  • fix(spec_cli): use fix `riverpod` as a quick fix to skip the migration to Riverpod 2.0.0

    fix(spec_cli): use fix `riverpod` as a quick fix to skip the migration to Riverpod 2.0.0

    The clean solution would to migrate to Riverpod 2.0.0. However, at the moment I don't have the time for this so I provided to a quick fix (using the a fixed riverpod version).

    Closes #28

    opened by nilsreichardt 1
  • Support `dart pub global run spec_cli`

    Support `dart pub global run spec_cli`

    Today when running Spec from somewhere where you don't have the installed dart packages on your path (like in cicd) you have to run:

    dart pub global run spec_cli:main
    

    It would be nice if it could support running:

    dart pub global run spec_cli
    

    Just like with Melos.

    bug help wanted hacktoberfest 
    opened by spydon 1
  • fix(spec_cli): set the default column when there is no terminal

    fix(spec_cli): set the default column when there is no terminal

    close #19

    If no terminal is attached to stdout, a StdoutException is thrown. Set the default columns when there is no terminal.

    https://api.dart.dev/stable/2.16.1/dart-io/Stdout/terminalColumns.html https://api.dart.dev/stable/2.16.1/dart-io/Stdout/hasTerminal.html

    dart packages/spec_cli/bin/main.dart --ci > test.log 
    
    Unhandled exception:
    StdoutException: Could not get terminal size, OS Error: Inappropriate ioctl for device, errno = 25
    #0      Stdout._terminalSize (dart:io-patch/stdio_patch.dart:145:7)
    #1      Stdout._terminalColumns (dart:io-patch/stdio_patch.dart:138:35)
    #2      Stdout.terminalColumns (dart:io/stdio.dart:205:30)
    #3      BacktrackingRenderer.renderFrame (package:spec_cli/src/renderer.dart:141:31)
    #4      spec.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:spec_cli/src/command_runner.dart:212:54)
    #5      AsyncValueX.when.<anonymous closure> (package:riverpod/src/common.dart:498:24)
    #6      AsyncData.map (package:riverpod/src/common.dart:273:16)
    #7      AsyncValueX.when (package:riverpod/src/common.dart:497:12)
    #8      spec.<anonymous closure>.<anonymous closure> (package:spec_cli/src/command_runner.dart:206:18)
    #9      _rootRunBinary (dart:async/zone.dart:1450:47)
    #10     _CustomZone.runBinary (dart:async/zone.dart:1342:19)
    #11     _CustomZone.runBinaryGuarded (dart:async/zone.dart:1252:7)
    #12     ProviderElementBase._notifyListeners.<anonymous closure> (package:riverpod/src/framework/provider_base.dart:557:24)
    #13     ResultData.map (package:riverpod/src/framework/provider_base.dart:1130:16)
    #14     ProviderElementBase._notifyListeners (package:riverpod/src/framework/provider_base.dart:554:14)
    #15     ProviderElementBase._performBuild (package:riverpod/src/framework/provider_base.dart:447:7)
    #16     ProviderElementBase.flush (package:riverpod/src/framework/provider_base.dart:415:7)
    #17     _ProviderScheduler._performRefresh (package:riverpod/src/framework/scheduler.dart:55:41)
    #18     _ProviderScheduler._task (package:riverpod/src/framework/scheduler.dart:41:5)
    #19     new Future.<anonymous closure> (dart:async/future.dart:252:37)
    #20     _rootRun (dart:async/zone.dart:1418:47)
    #21     _CustomZone.run (dart:async/zone.dart:1328:19)
    #22     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
    #23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
    #24     _rootRun (dart:async/zone.dart:1426:13)
    #25     _CustomZone.run (dart:async/zone.dart:1328:19)
    #26     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1260:23)
    #27     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
    #28     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
    #29     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
    #30     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
    

    close https://github.com/amondnet/oss/issues/4

    opened by amondnet 0
  • cannot be used with github actions

    cannot be used with github actions

    on:
      push:
        branches:
          - main
    jobs:
      test:
        name: test
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v2
          - uses: dart-lang/setup-dart@v1
          - name: Install dependencies
            run: dart pub get      
          - run: dart pub global activate spec_cli
          - run: spec --coverage --ci
    

    https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true

    Run spec --coverage --ci
    Unhandled exception:
    StdoutException: Could not get terminal size, OS Error: Inappropriate ioctl for device, errno = 25
    #0      Stdout._terminalSize (dart:io-patch/stdio_patch.dart:145:7)
    #1      Stdout._terminalColumns (dart:io-patch/stdio_patch.dart:13[8](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:8):35)
    #2      Stdout.terminalColumns (dart:io/stdio.dart:205:30)
    #3      BacktrackingRenderer.renderFrame (package:spec_cli/src/renderer.dart:141:31)
    #4      spec.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:spec_cli/src/command_runner.dart:212:54)
    #5      AsyncValueX.when.<anonymous closure> (package:riverpod/src/common.dart:4[9](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:9)8:24)
    #6      AsyncData.map (package:riverpod/src/common.dart:273:16)
    #7      AsyncValueX.when (package:riverpod/src/common.dart:497:12)
    #8      spec.<anonymous closure>.<anonymous closure> (package:spec_cli/src/command_runner.dart:206:18)
    #9      _rootRunBinary (dart:async/zone.dart:1450:47)
    #[10](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:10)     _CustomZone.runBinary (dart:async/zone.dart:1342:19)
    #[11](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:11)     _CustomZone.runBinaryGuarded (dart:async/zone.dart:[12](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:12)52:7)
    #12     ProviderElementBase._notifyListeners.<anonymous closure> (package:riverpod/src/framework/provider_base.dart:557:24)
    #[13](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:13)     ResultData.map (package:riverpod/src/framework/provider_base.dart:1130:16)
    #[14](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:14)     ProviderElementBase._notifyListeners (package:riverpod/src/framework/provider_base.dart:554:14)
    #[15](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:15)     ProviderElementBase._performBuild (package:riverpod/src/framework/provider_base.dart:447:7)
    #[16](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:16)     ProviderElementBase.flush (package:riverpod/src/framework/provider_base.dart:415:7)
    #[17](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:17)     _ProviderScheduler._performRefresh (package:riverpod/src/framework/scheduler.dart:55:41)
    #[18](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:18)     _ProviderScheduler._task (package:riverpod/src/framework/scheduler.dart:41:5)
    #[19](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:19)     new Future.<anonymous closure> (dart:async/future.dart:252:37)
    #[20](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:20)     _rootRun (dart:async/zone.dart:1418:47)
    #[21](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:21)     _CustomZone.run (dart:async/zone.dart:1328:19)
    #[22](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:22)     _CustomZone.runGuarded (dart:async/zone.dart:1[23](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:23)6:7)
    #23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
    #[24](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:24)     _rootRun (dart:async/zone.dart:1426:13)
    #[25](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:25)     _CustomZone.run (dart:async/zone.dart:1328:19)
    #[26](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:26)     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1260:23)
    #[27](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:27)     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
    #[28](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:28)     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
    #[29](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:29)     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
    #[30](https://github.com/amondnet/spec_test/runs/5597378548?check_suite_focus=true#step:6:30)     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
    25l PASS  test/spec_test_test.dart
    Error: Process completed with exit code 255.
    
    opened by amondnet 0
  • Set location of Flutter/Dart SDK

    Set location of Flutter/Dart SDK

    At the moment, spec just uses the global Flutter version that is used when running flutter or dart. However, you might want to pass the path to another SDK path, like when using FVM.

    It would be great when you set the path to the Flutter / Dart SDK or what the best option would be to use the location from the melos.yaml (https://melos.invertase.dev/configuration/overview#sdkpath) - related to #9 (?)

    opened by nilsreichardt 1
  • Cursor disappears after running `spec`

    Cursor disappears after running `spec`

    Demo

    https://user-images.githubusercontent.com/24459435/198004003-201f9d57-539f-4f12-b39b-154622b59cad.mov

    Steps to reproduce

    dart pub global activate spec_cli
    flutter create temp
    cd temp
    spec
    

    Additional context

    • MacBook Pro M1
    • macOS 12.6
    question 
    opened by nilsreichardt 3
  • Fix the test suite so that it passes for Windows

    Fix the test suite so that it passes for Windows

    Currently most of the tests fails when running the test suite on windows in the pipeline (well, on real machines too I expect).

    The problem is that paths on windows use \ instead of /, which creates test fails such as these:

    [spec_cli]: Expected: contains 'PASS  test/my_test.dart'
    [spec_cli]:   Actual: ' PASS  test\\another_test.dart\n'
    [spec_cli]:             ' PASS  test\\my_test.dart\n'
    [spec_cli]:             '\n'
    [spec_cli]:             'Test Suites: 2 passed, 2 total\n'
    [spec_cli]:             'Tests:       3 passed, 3 total\n'
    [spec_cli]:             'Time:        00:00:00\n'
    [spec_cli]:             ''
    

    I can't think of any other solution than to pass all the strings through some function that fixes the paths depending on platform in all the tests.

    opened by spydon 0
  • feat: support --update-goldens

    feat: support --update-goldens

    hello, I have added support for --update-golden option. It works for --watch mode too, however, I had to filter some files from an observer.

    I have added 'g' keyboard shortcut to toggling update goldens mode. CleanShot 2022-10-01 at 12 32 10

    temporary I've pinned riverpod to 2.0.0-dev.3.

    Closes #8

    PS. It's my first contribution ever so sorry if I did something wrong.

    opened by trejdych 9
  • [Question] Does this support passing individual test files/directories?

    [Question] Does this support passing individual test files/directories?

    I tried running my tests by simply calling spec in the root folder and it only picked up tests in a packages/test folder and ignored the ones in the main test folder.

    When I pass individual test files as I would with flutter_test as in flutter test test/path/to_test.dart, Spec does not find the tests and runs nothing.

    Is using melos in this case required or is there an option I have not yet found?

    hacktoberfest 
    opened by lyio 9
Releases(spec_cli-v0.1.1)
Owner
Invertase
Building awesome open source products.
Invertase
Custom flutter testing CLI tool for individual test runs and group testing

fluttertest Custom flutter testing CLI tool for inidividual test runs or group testing Overview Flutter is a great framework which has helps developer

vi_mi 15 Nov 6, 2022
Simple and complete Flutter hooks testing utilities that encourage good testing practices.

Flutter Hooks Testing Library Simple and complete Flutter hooks testing utilities that encourage good testing practices. Inspired by react-hooks-testi

Daichi Furiya 24 Dec 2, 2022
Flutter_news - News application developed for practice, learning and testing the potential of this powerful Framework Flutter

flutter_news News application developed for practice, learning and testing the potential of this powerful Google's UI toolkit. Resources Packages pub

Rafael Almeida Barbosa 487 Dec 17, 2022
Flying Fish is full-stack Dart framework - a semi-opinionated framework for building applications exclusively using Dart and Flutter

Flying Fish is full-stack Dart framework - a semi-opinionated framework for building applications exclusively using Dart and Flutter.

Flutter Fish 3 Dec 27, 2022
Tello-Dart - A testing ground for the Tello drone's socket API in dart

This packages provides a Dart interface to Ryze Tello drones. Getting started Ma

null 2 Jul 27, 2022
Intel Corporation 238 Dec 24, 2022
The ROHD Verification Framework is a hardware verification framework built upon ROHD for building testbenches.

ROHD Verification Framework The ROHD Verification Framework (ROHD-VF) is a verification framework built upon the Rapid Open Hardware Development (ROHD

Intel Corporation 18 Dec 20, 2022
Bilgi Testi Flutter - A knowledge testing app built with Flutter

Bilgi Testi 7 sorudan oluşan puanlama mekaniği olan, modern tasarımlı, flutter i

null 0 Feb 9, 2022
Integrationtestapp - Introduction and example on Flutter Integration Testing

integrationtestapp Flutter Project with integration test example. Setup integrat

null 0 Feb 11, 2022
A Flutter tool that makes golden testing easy.

???? Alchemist Developed with ?? by Very Good Ventures ?? and Betterment ☀️ . A Flutter tool that makes golden testing easy. Alchemist is a Flutter pa

Betterment 210 Dec 12, 2022
A test driver for Flutter to do QA testing without sharing app source code.

Autopilot A test driver for Flutter to do QA testing without sharing app source code. It exposes a JSON API using an HTTP server running inside the ap

Ajin Asokan 70 Dec 30, 2022
Raden Saleh 20 Aug 12, 2023
Raden Saleh 53 Jul 27, 2023
A simple test testing swagger_dart_code_generator 2.2.5+1

m_work_swagger_test_2 A simple test testing swagger_dart_code_generator 2.2.5+1 Was created like this: Create an ordinary Flutter project in AS2020.3.

Roar Grønmo 0 Nov 15, 2021
Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance reports for you.

ozzie.flutter Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance r

Jorge Coca 40 Nov 3, 2022
Testing Teams, Projects and general collaboration on Github

collaboration_test Testing Teams, Projects and general collaboration on Github Getting Started This project is a starting point for a Flutter applicat

null 1 Dec 3, 2021
Value listenable test - Assists in testing ValueListenable objects (ex: ValueNotifier).

value_listenable_test Assists in testing ValueListenable objects (ex: ValueNotifier). install Added in your pubspec.yaml as dev dependency: dev_depend

Flutterando 3 Feb 23, 2022
An app just for testing out Google Authentication using Firebase

Google Authentication An app just for testing out Google Authentication using Fi

Harshit Sharma 2 Feb 21, 2022