very_good_workflows
very_good_workflows copied to clipboard
feat: "--dart-define" option in test
https://github.com/flutter/flutter/issues/34505
import 'package:flutter/foundation.dart';
String foo() {
if (kReleaseMode) {
return null;
}
return _calculateABunchOfStuffAndReturnALongString();
}
To cover source code above, --dart-define option is needed.
For example, to testing device in release mode,
flutter test --dart-define=dart.vm.product=true