非常好的测试运行器
由 Very Good Ventures 开发
这个包是 Very Good Ventures 为 Flutter 和 Dart 创建的测试运行器。它旨在在编写运行 Flutter 或 Dart 测试并公开 TestEvent 流的自定义工具时使用。有关各种 TestEvent 类型的更多信息,请参阅 JSON Reporter Test Protocol。
用法
import 'package:very_good_test_runner/very_good_test_runner.dart';
void main() {
const arguments = ['--coverage'];
const workingDirectory = 'path/to/project';
// Run `dart test` process.
dartTest(
arguments: arguments,
workingDirectory: workingDirectory,
).listen((TestEvent event) {
// React to `TestEvent` instances.
print(event);
});
// Run `flutter test` process.
flutterTest(
arguments: arguments,
workingDirectory: workingDirectory,
).listen((TestEvent event) {
// React to `TestEvent` instances.
print(event);
});
}
