Skip to content

Commit

Permalink
refactor: add visibleForTesting annotations to testing-related parame…
Browse files Browse the repository at this point in the history
…ters (#823)

* adding visibleForTesting annotation parameters exclusive for testing purpose

* removing the visible-for-testing annotation from logger and pubUpdater

* formatted the packages.dart file

* removing the visible-for-testing annotation from logger and pubUpdater in command_runner.dart file

* removed the unused meta import from command_runner.dart file

* resolving the push conflict
  • Loading branch information
superiorsd10 committed Oct 2, 2023
1 parent 8ae689f commit d4a0763
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ dart fix --apply
[conventional_commits_link]: https://www.conventionalcommits.org/en/v1.0.0
[bug_report_link]: https://github.com/VeryGoodOpenSource/very_good_cli/issues/new?assignees=&labels=bug&template=bug_report.md&title=fix%3A+
[very_good_core_link]: doc/very_good_core.md
[very_good_ventures_link]: https://verygood.ventures/?utm_source=github&utm_medium=banner&utm_campaign=CLI
[very_good_ventures_link]: https://verygood.ventures/?utm_source=github&utm_medium=banner&utm_campaign=CLI
4 changes: 2 additions & 2 deletions lib/src/commands/create/commands/create_subcommand.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ abstract class CreateSubCommand extends Command<int> {
/// {@macro create_subcommand}
CreateSubCommand({
required this.logger,
required MasonGeneratorFromBundle? generatorFromBundle,
required MasonGeneratorFromBrick? generatorFromBrick,
@visibleForTesting required MasonGeneratorFromBundle? generatorFromBundle,
@visibleForTesting required MasonGeneratorFromBrick? generatorFromBrick,
}) : _generatorFromBundle = generatorFromBundle ?? MasonGenerator.fromBundle,
_generatorFromBrick = generatorFromBrick ?? MasonGenerator.fromBrick {
argParser
Expand Down
5 changes: 3 additions & 2 deletions lib/src/commands/create/create.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:args/command_runner.dart';
import 'package:mason/mason.dart';
import 'package:meta/meta.dart';
import 'package:very_good_cli/src/commands/create/commands/commands.dart';

/// {@template create_command}
Expand All @@ -12,8 +13,8 @@ class CreateCommand extends Command<int> {
/// {@macro create_command}
CreateCommand({
required Logger logger,
MasonGeneratorFromBundle? generatorFromBundle,
MasonGeneratorFromBrick? generatorFromBrick,
@visibleForTesting MasonGeneratorFromBundle? generatorFromBundle,
@visibleForTesting MasonGeneratorFromBrick? generatorFromBrick,
}) {
// very_good create flutter_app <args>
addSubcommand(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/commands/test/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class TestCommand extends Command<int> {
/// {@macro test_command}
TestCommand({
required Logger logger,
FlutterInstalledCommand? flutterInstalled,
FlutterTestCommand? flutterTest,
@visibleForTesting FlutterInstalledCommand? flutterInstalled,
@visibleForTesting FlutterTestCommand? flutterTest,
}) : _logger = logger,
_flutterInstalled = flutterInstalled ?? Flutter.installed,
_flutterTest = flutterTest ?? Flutter.test {
Expand Down

0 comments on commit d4a0763

Please sign in to comment.