very_good_workflows icon indicating copy to clipboard operation
very_good_workflows copied to clipboard

feat: "--dart-define" option in test

Open SuhwanCha opened this issue 3 years ago • 0 comments

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

SuhwanCha avatar Dec 08 '22 03:12 SuhwanCha