-
Notifications
You must be signed in to change notification settings - Fork 208
feat(test): add --dart-define #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(test): add --dart-define #492
Conversation
FYI: It seems that the CI test task is a bit flaky. I got the following error on my first CI run. When I reran the CI task with the same code, it succeeded without any errors. https://github.com/VeryGoodOpenSource/very_good_cli/runs/8308620438?check_suite_focus=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks so much for the contribution!
Description
This PR adds the
--dart-define
parameter to the test command.--dart-define
is used to define compile-time constants which are then available through theString.fromEnvironment
,bool.fromEnvironment
,int.fromEnvironment
, anddouble.fromEnvironment
constructors.Tests relying on such compile-time constants can currently not be run with
very_good test
, because the command doesn't yet accept the--dart-define
parameter.An example where one would use a
--dart-define
compile-time constant is to switch between different environments or flavors of an app. E.g.--dart-define=APP_ENVIRONMENT=dev
.This is useful because code as the following is automatically deleted in an optimization step when building an app:
Type of Change