Skip to content

Commit ea81730

Browse files
committed
Refactor WebAppOptions initialization for improved readability in tests
1 parent 661aff1 commit ea81730

File tree

1 file changed

+13
-33
lines changed

1 file changed

+13
-33
lines changed

packages/patrol_cli/test/crossplatform/app_options_test.dart

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,7 @@ void main() {
543543
dartDefineFromFilePaths: [],
544544
);
545545

546-
options = const WebAppOptions(
547-
flutter: flutterOpts,
548-
);
546+
options = const WebAppOptions(flutter: flutterOpts);
549547

550548
final flutterInvocation = options.toFlutterBuildInvocation();
551549

@@ -573,9 +571,7 @@ void main() {
573571
dartDefineFromFilePaths: [],
574572
);
575573

576-
options = const WebAppOptions(
577-
flutter: flutterOpts,
578-
);
574+
options = const WebAppOptions(flutter: flutterOpts);
579575

580576
final flutterInvocation = options.toFlutterBuildInvocation();
581577

@@ -607,9 +603,7 @@ void main() {
607603
dartDefineFromFilePaths: [],
608604
);
609605

610-
options = const WebAppOptions(
611-
flutter: flutterOpts,
612-
);
606+
options = const WebAppOptions(flutter: flutterOpts);
613607

614608
final flutterInvocation = options.toFlutterBuildInvocation();
615609

@@ -640,9 +634,7 @@ void main() {
640634
dartDefineFromFilePaths: ['defines.json', 'secrets.env'],
641635
);
642636

643-
options = const WebAppOptions(
644-
flutter: flutterOpts,
645-
);
637+
options = const WebAppOptions(flutter: flutterOpts);
646638

647639
final flutterInvocation = options.toFlutterBuildInvocation();
648640

@@ -668,16 +660,11 @@ void main() {
668660
flavor: null,
669661
buildName: null,
670662
buildNumber: null,
671-
dartDefines: {
672-
'ENV': 'production',
673-
'DEBUG_MODE': 'false',
674-
},
663+
dartDefines: {'ENV': 'production', 'DEBUG_MODE': 'false'},
675664
dartDefineFromFilePaths: ['config.json'],
676665
);
677666

678-
options = const WebAppOptions(
679-
flutter: flutterOpts,
680-
);
667+
options = const WebAppOptions(flutter: flutterOpts);
681668

682669
final flutterInvocation = options.toFlutterBuildInvocation();
683670

@@ -697,10 +684,10 @@ void main() {
697684
});
698685

699686
test('with custom flutter command arguments', () {
700-
const customFlutterCommand = FlutterCommand(
701-
'flutter',
702-
['--verbose', '--no-pub'],
703-
);
687+
const customFlutterCommand = FlutterCommand('flutter', [
688+
'--verbose',
689+
'--no-pub',
690+
]);
704691

705692
const flutterOpts = FlutterAppOptions(
706693
command: customFlutterCommand,
@@ -713,9 +700,7 @@ void main() {
713700
dartDefineFromFilePaths: [],
714701
);
715702

716-
options = const WebAppOptions(
717-
flutter: flutterOpts,
718-
);
703+
options = const WebAppOptions(flutter: flutterOpts);
719704

720705
final flutterInvocation = options.toFlutterBuildInvocation();
721706

@@ -747,9 +732,7 @@ void main() {
747732
dartDefineFromFilePaths: [],
748733
);
749734

750-
options = const WebAppOptions(
751-
flutter: flutterOpts,
752-
);
735+
options = const WebAppOptions(flutter: flutterOpts);
753736

754737
final flutterInvocation = options.toFlutterBuildInvocation();
755738

@@ -764,10 +747,7 @@ void main() {
764747
'--release',
765748
]),
766749
);
767-
expect(
768-
flutterInvocation,
769-
isNot(contains('--flavor')),
770-
);
750+
expect(flutterInvocation, isNot(contains('--flavor')));
771751
});
772752
});
773753
});

0 commit comments

Comments
 (0)