butcher 0.3.0
butcher: ^0.3.0 copied to clipboard
Mutation testing for Dart; rewrites the source into mutants and scores which ones the tests kill.
import 'package:butcher/butcher.dart';
Future<void> main() async {
final engine = Engine(
projectRoot: '.',
paths: ButcherPaths.systemTemp(),
onProgress: (done, total, result) =>
print('[$done/$total] ${result.mutant.id} -> ${result.outcome.name}'),
);
final result = await engine.run();
await ConsoleReportSink().write(result.results);
await StrykerJsonSink(
sources: result.sources,
outputPath: 'mutation-report.json',
).write(result.results);
}