From 31a905ec37e43ce5734d56b1d00bf699a6db3ce5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:32:24 +0000 Subject: [PATCH 1/8] chore(deps): bump very_good_analysis from 6.0.0 to 7.0.0 Bumps [very_good_analysis](https://github.com/VeryGoodOpenSource/very_good_analysis) from 6.0.0 to 7.0.0. - [Release notes](https://github.com/VeryGoodOpenSource/very_good_analysis/releases) - [Changelog](https://github.com/VeryGoodOpenSource/very_good_analysis/blob/main/CHANGELOG.md) - [Commits](https://github.com/VeryGoodOpenSource/very_good_analysis/compare/v6.0.0...v7.0.0) --- updated-dependencies: - dependency-name: very_good_analysis dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a727178..7dd052c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,4 +17,4 @@ dependencies: test: ^1.25.7 dev_dependencies: - very_good_analysis: ^6.0.0 + very_good_analysis: ">=6.0.0 <8.0.0" From c7b26518cbe72a50040a9bac40be7eb4bdc2e156 Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Wed, 18 Dec 2024 13:55:27 -0600 Subject: [PATCH 2/8] update analysis file --- analysis_options.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index bb72091..c2f4cbb 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1 @@ -include: package:very_good_analysis/analysis_options.6.0.0.yaml +include: package:very_good_analysis/analysis_options.7.0.0.yaml From 2263a13c655953be8e7d2110334586069e12f109 Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Wed, 18 Dec 2024 14:02:43 -0600 Subject: [PATCH 3/8] analyzer fixes --- lib/mockingjay.dart | 2 +- lib/src/matchers.dart | 2 +- lib/src/mock_navigator.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mockingjay.dart b/lib/mockingjay.dart index 997aaab..55cb951 100644 --- a/lib/mockingjay.dart +++ b/lib/mockingjay.dart @@ -1,6 +1,6 @@ /// A package that makes it easy to mock, test and verify /// navigation calls in Flutter. -library mockingjay; +library; export 'package:mocktail/mocktail.dart'; diff --git a/lib/src/matchers.dart b/lib/src/matchers.dart index 9712a00..0e4b832 100644 --- a/lib/src/matchers.dart +++ b/lib/src/matchers.dart @@ -94,7 +94,7 @@ class _RouteMatcher extends Matcher { hasMaintainStateMatcher || hasFullscreenDialogMatcher; - /// Takes an [input] string that looks like "FooBarRoute" and extracts + /// Takes an [input] string that looks like "FooBarRoute\" and extracts /// the part "MyType". /// /// If the `Route<` part cannot be found, it returns the input string diff --git a/lib/src/mock_navigator.dart b/lib/src/mock_navigator.dart index ad31c4c..8be7ac7 100644 --- a/lib/src/mock_navigator.dart +++ b/lib/src/mock_navigator.dart @@ -17,7 +17,7 @@ class _MockMaterialPageRoute extends MaterialPageRoute { // By the time the setState is called, the attribute is already set // so we just ignore the error and the hack will do its job. state.insert(entry); - } catch (_) {} + } on Exception catch (_) {} // Set mounted back to false to make sure the state doesn't get // marked as dirty during OverlayEntry.remove(). state._mounted = false; From 403290233021eeb161bed98aea628fb3f005a644 Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Wed, 18 Dec 2024 14:05:08 -0600 Subject: [PATCH 4/8] html comments fix --- lib/src/matchers.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/matchers.dart b/lib/src/matchers.dart index 0e4b832..1fc2fbf 100644 --- a/lib/src/matchers.dart +++ b/lib/src/matchers.dart @@ -94,7 +94,7 @@ class _RouteMatcher extends Matcher { hasMaintainStateMatcher || hasFullscreenDialogMatcher; - /// Takes an [input] string that looks like "FooBarRoute\" and extracts + /// Takes an [input] string that looks like `FooBarRoute` and extracts /// the part "MyType". /// /// If the `Route<` part cannot be found, it returns the input string From 35571f489275f30832e2da330e712cb6f1ba7646 Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Fri, 20 Dec 2024 14:03:04 -0600 Subject: [PATCH 5/8] analysis fix --- lib/src/matchers.dart | 1 + test/src/matchers_test.dart | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/src/matchers.dart b/lib/src/matchers.dart index 1fc2fbf..c9572ed 100644 --- a/lib/src/matchers.dart +++ b/lib/src/matchers.dart @@ -27,6 +27,7 @@ Matcher isRoute({ }) { // Remove once `named` argument is removed. if (whereName == null && named != null) { + // Nullable parameter so assignment is OK // ignore: parameter_assignments whereName = equals(named); } diff --git a/test/src/matchers_test.dart b/test/src/matchers_test.dart index d640800..4633115 100644 --- a/test/src/matchers_test.dart +++ b/test/src/matchers_test.dart @@ -51,9 +51,11 @@ void main() { group('constructor', () { test('wraps deprecated name value in equals matcher', () { expect( + // Specifically testing deprecated member here // ignore: deprecated_member_use_from_same_package isRoute(named: '/test'), isA().having( + // Expecting Dynamic here // ignore: avoid_dynamic_calls (dynamic m) => m.whereName, 'whereName', From fa530460331f83e0e26abb0542ed52cf66b7be78 Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Fri, 20 Dec 2024 14:08:34 -0600 Subject: [PATCH 6/8] getting tests to pass --- lib/src/mock_navigator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/mock_navigator.dart b/lib/src/mock_navigator.dart index 8be7ac7..36de874 100644 --- a/lib/src/mock_navigator.dart +++ b/lib/src/mock_navigator.dart @@ -17,7 +17,7 @@ class _MockMaterialPageRoute extends MaterialPageRoute { // By the time the setState is called, the attribute is already set // so we just ignore the error and the hack will do its job. state.insert(entry); - } on Exception catch (_) {} + } on Object catch (_) {} // Set mounted back to false to make sure the state doesn't get // marked as dirty during OverlayEntry.remove(). state._mounted = false; From 0081a09b62c491e136c6241b844eafaf8b44abf7 Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Fri, 20 Dec 2024 14:08:55 -0600 Subject: [PATCH 7/8] correc tpubspec --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7dd052c..49dce7d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,4 +17,4 @@ dependencies: test: ^1.25.7 dev_dependencies: - very_good_analysis: ">=6.0.0 <8.0.0" + very_good_analysis: ^7.0.0 From 3dd85dc2c4d90b4f426bfa06cbf8fc37815385fd Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Wed, 15 Jan 2025 09:48:06 -0600 Subject: [PATCH 8/8] Update lib/src/matchers.dart Co-authored-by: Jochum van der Ploeg --- lib/src/matchers.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/matchers.dart b/lib/src/matchers.dart index c9572ed..01f1cd8 100644 --- a/lib/src/matchers.dart +++ b/lib/src/matchers.dart @@ -27,7 +27,7 @@ Matcher isRoute({ }) { // Remove once `named` argument is removed. if (whereName == null && named != null) { - // Nullable parameter so assignment is OK + // Reassigning it to the parameter to make the code flow nicer. // ignore: parameter_assignments whereName = equals(named); }