dart_test_adapter
프로그래밍 방식으로 `dart test`/`flutter test`와 상호 작용하기 위한 Dart API를 제공합니다
✅ Dart 및 Flutter용 간편한 테스트 프레임워크입니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Melos docs.page Chat on Discord
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.
The Spec CLI allows you to run the spec command from your CLI environment and run your tests:
spec --watch); automatically re-run tests when source code changes & rerunning of only failed tests.spec
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.
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();
});
}
dart pub global activate spec_cli
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.
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.
https://static.invertase.io/assets/invertase/invertase-rounded-avatar.png
Built and maintained by Invertase.