-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Conversation
Codecov Report
@@ Coverage Diff @@
## refactor/bloc-base #2067 +/- ##
====================================================
Coverage 100.00% 100.00%
====================================================
Files 11 14 +3
Lines 213 268 +55
====================================================
+ Hits 213 268 +55
Continue to review full report at Codecov.
|
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, 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" |
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.
👀
@@ -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(); |
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.
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();
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.
Yeah that would still work but we can also do:
verify(counterCubit).called(#decrement).withArgs(positional: [any]).once();
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
* 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]>
Status
READY
Breaking Changes
YES
Description
Type of Change