run_with_print 0.0.2 copy "run_with_print: ^0.0.2" to clipboard
run_with_print: ^0.0.2 copied to clipboard

Helper for getting the print output in tests.

example/run_with_print_example.dart

// ignore_for_file: avoid_print

import 'dart:io';

import 'package:run_with_print/run_with_print.dart';

void main() async {
  runWithPrint((logs) {
    print('test log');
    print('test message');
    stdout.writeln('print logs length: ${logs.length}');
    stdout.writeln(logs);
  });

  await runWithPrint((logs) async {
    print('test log');
    await Future.delayed(const Duration());
    print('test message');
    await Future.delayed(const Duration());
    stdout.writeln('print logs length: ${logs.length}');
    stdout.writeln(logs);
  });
}
0
likes
140
points
183
downloads

Publisher

unverified uploader

Weekly Downloads

Helper for getting the print output in tests.

Documentation

API reference

License

MIT (license)

More

Packages that depend on run_with_print