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

Don't trigger provider scoped lints in tests #3056

Merged
merged 6 commits into from
Oct 31, 2023

Conversation

lockieRichter
Copy link
Contributor

@lockieRichter lockieRichter commented Oct 29, 2023

Updates the scoped_providers_should_specify_dependencies to ignore instances of using pumpWidget in tests

@codecov
Copy link

codecov bot commented Oct 29, 2023

Codecov Report

Merging #3056 (5483363) into master (222d287) will increase coverage by 0.01%.
Report is 7 commits behind head on master.
The diff coverage is n/a.

❗ Current head 5483363 differs from pull request most recent head 9d1c5d8. Consider uploading reports for the commit 9d1c5d8 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3056      +/-   ##
==========================================
+ Coverage   95.29%   95.30%   +0.01%     
==========================================
  Files          53       53              
  Lines        2274     2281       +7     
==========================================
+ Hits         2167     2174       +7     
  Misses        107      107              

see 3 files with indirect coverage changes

@lockieRichter lockieRichter force-pushed the handle-tests-for-lints branch 2 times, most recently from d0b6658 to 9ca4115 Compare October 30, 2023 01:14
@lockieRichter lockieRichter marked this pull request as ready for review October 30, 2023 01:42
@@ -14,3 +14,4 @@ dependency_overrides:
path: ../riverpod_annotation
riverpod_lint:
path: ../riverpod_lint
test_api: ^0.6.1
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

flutter_test has a pinned dependency on test_api: 0.6.0 but the test package needs test_api: ^0.61. Needed to do this to get the packages all playing nicely.

void someTestFunction() {
testWidgets('override repositoryProvider in test', (tester) async {
await tester.pumpWidget(
ProviderScope(
Copy link
Owner

Choose a reason for hiding this comment

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

We need a test where ProviderScope is not prevent in pumpWidget

And one where ProviderScope is prevent within pumpWidget, but is not the very first widget

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wil do, slick!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some more tests covering these cases.

rrousselGit
rrousselGit previously approved these changes Oct 30, 2023
Copy link
Owner

@rrousselGit rrousselGit left a comment

Choose a reason for hiding this comment

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

LGTM once a few extra test cases are added

@rrousselGit
Copy link
Owner

Looking good, thanks!

@rrousselGit rrousselGit merged commit 7e92376 into rrousselGit:master Oct 31, 2023
38 of 42 checks passed
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.

2 participants