Skip to content
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

refactor!(bloc_test): null safety #2067

Merged
merged 4 commits into from
Jan 12, 2021

Conversation

felangel
Copy link
Owner

@felangel felangel commented Jan 9, 2021

Status

READY

Breaking Changes

YES

Description

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

@felangel felangel added pkg:bloc_test This issue is related to the bloc_test package breaking change Enhancement candidate would introduce a breaking change refactor Refactor an existing implementation labels Jan 9, 2021
@felangel felangel self-assigned this Jan 9, 2021
@codecov
Copy link

codecov bot commented Jan 9, 2021

Codecov Report

Merging #2067 (62929cc) into refactor/bloc-base (3c9f84f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##           refactor/bloc-base     #2067   +/-   ##
====================================================
  Coverage              100.00%   100.00%           
====================================================
  Files                      11        14    +3     
  Lines                     213       268   +55     
====================================================
+ Hits                      213       268   +55     
Impacted Files Coverage Δ
packages/bloc_test/lib/src/bloc_test.dart 100.00% <100.00%> (ø)
packages/bloc_test/lib/src/mock_bloc.dart 100.00% <100.00%> (ø)
packages/bloc_test/lib/src/when_listen.dart 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c9f84f...62929cc. Read the comment docs.

@felangel felangel requested a review from jorgecoca January 12, 2021 04:56
@felangel felangel marked this pull request as ready for review January 12, 2021 04:56
Copy link
Collaborator

@jorgecoca jorgecoca left a comment

Choose a reason for hiding this comment

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

LGTM, just had one question


dev_dependencies:
flutter_test:
sdk: flutter
bloc_test: ^7.1.0
mockito: ^4.0.0
mocktail: ">=0.0.1-dev.7 <0.1.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

👀

@@ -61,7 +61,7 @@ void main() {
final decrementFinder = find.byKey(_decrementButtonKey);
await tester.ensureVisible(decrementFinder);
await tester.tap(decrementFinder);
verify(counterCubit.decrement()).called(1);
verify(counterCubit).called(#decrement).once();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, but I want to make sure we cover all cases: if we use symbols, how can we verify a call with arguments?

For example, if the signature of decrement were void decrement(int value), would you still do 👇 ?

verify(counterCubit).called(#decrement).once();

Copy link
Owner Author

@felangel felangel Jan 12, 2021

Choose a reason for hiding this comment

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

Yeah that would still work but we can also do:

verify(counterCubit).called(#decrement).withArgs(positional: [any]).once();

@felangel felangel merged commit 5ba2700 into refactor/bloc-base Jan 12, 2021
@felangel felangel deleted the refactor/bloc_test-null-safety branch January 12, 2021 15:09
felangel added a commit that referenced this pull request Jan 13, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
@felangel felangel mentioned this pull request Jan 13, 2021
17 tasks
felangel added a commit that referenced this pull request Jan 18, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Jan 21, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Jan 31, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Jan 31, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Feb 6, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Feb 8, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Feb 11, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Feb 14, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Mar 3, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
felangel added a commit that referenced this pull request Mar 4, 2021
* docs: fix typo in fluttertodostutorial.md (#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
AndreiGS pushed a commit to AndreiGS/bloc_shopping_example_complete that referenced this pull request Dec 8, 2024
* docs: fix typo in fluttertodostutorial.md (felangel#2036)

* ci: update docs workflow to use create-an-issue@v2

* refactor!: cubit extends bloc

* feat(bloc_test): bloc-base refactor

* refactor: update imports

* revert: bloc_test changes

* refactor: simplify controller initialization and getters

* refactor!(bloc_test): null safety (felangel#2067)

* refactor!(bloc_test): null safety

* ci: use Dart 2.12

* chore: fix tests and bump to mocktail 0.0.1-dev.7

* refactor(bloc_test): minor improvements and documentation updates

* refactor: remove redundant _observer

Co-authored-by: Cervon Wong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Enhancement candidate would introduce a breaking change pkg:bloc_test This issue is related to the bloc_test package refactor Refactor an existing implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants