Skip to content

refactor: add visibleForTesting annotations to testing-related parameters#823

Merged
renancaraujo merged 7 commits intoVeryGoodOpenSource:mainfrom
superiorsd10:visible-for-testing-annotation
Oct 2, 2023
Merged

refactor: add visibleForTesting annotations to testing-related parameters#823
renancaraujo merged 7 commits intoVeryGoodOpenSource:mainfrom
superiorsd10:visible-for-testing-annotation

Conversation

@superiorsd10
Copy link
Contributor

@superiorsd10 superiorsd10 commented Sep 30, 2023

Description

Throughout the codebase, there are instances where classes have optional parameters designed for dependency injection during testing. This PR adds visibleForTesting annotations to explicitly mark these parameters for testing purposes.

Resolves #761

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

UpdateCommand({
required Logger logger,
PubUpdater? pubUpdater,
@visibleForTesting PubUpdater? pubUpdater,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for test only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I've realized my mistake. Sorry, I'll be making the required changes now.

class PackagesCommand extends Command<int> {
/// {@macro packages_command}
PackagesCommand({Logger? logger}) {
PackagesCommand({@visibleForTesting Logger? logger}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for test only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I've realized my mistake. Sorry, I'll be making the required changes now.

@superiorsd10 superiorsd10 force-pushed the visible-for-testing-annotation branch from 0e091b3 to 5cba1de Compare October 2, 2023 11:01
@renancaraujo renancaraujo merged commit d4a0763 into VeryGoodOpenSource:main Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: include visibleForTesting annotation on test parameters

2 participants