Skip to content

Commit 5dd4e87

Browse files
committed
feat: 0.2.0-dev.1
1 parent 556a761 commit 5dd4e87

File tree

10 files changed

+599
-157
lines changed

10 files changed

+599
-157
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 0.2.0-dev.1
2+
3+
- feat: add `whereSettings`, `whereName`, `whereArguments`, `whereMaintainState` and `whereFullscreenDialog` matcher arguments to `isRoute` matcher
4+
- **DEPRECATE**: fix: `named` argument on `isRoute` deprecated in favor of `whereName`
5+
16
# 0.1.1
27

38
- refactor: reorder mock navigator provider parameters ([#14](https://github.com/VeryGoodOpenSource/mockingjay/pull/14), thanks [@JigneshPatel23](https://github.com/JigneshPatel23))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void main() {
9090
await tester.tap(find.byType(TextButton));
9191
9292
verify(
93-
() => navigator.push(any(that: isRoute<void>(named: '/settings'))),
93+
() => navigator.push(any(that: isRoute<void>(whereName: equals('/settings')))),
9494
).called(1);
9595
});
9696
}

example/test/ui/home_screen_test.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ void main() {
5151

5252
verify(
5353
() => navigator.push(
54-
any(that: isRoute<String?>(named: '/pincode_screen')),
54+
any(that: isRoute<String?>(whereName: equals('/pincode_screen'))),
5555
),
5656
).called(1);
5757
});
5858

5959
testWidgets('displays snackbar with selected pincode', (tester) async {
6060
when(() => navigator.push(
61-
any(that: isRoute<String?>(named: '/pincode_screen')),
61+
any(that: isRoute<String?>(whereName: equals('/pincode_screen'))),
6262
)).thenAnswer((_) async => '123456');
6363

6464
await tester.pumpTest(
@@ -82,9 +82,15 @@ void main() {
8282
testWidgets(
8383
'displays snackbar when no pincode was submitted',
8484
(tester) async {
85-
when(() => navigator.push(
86-
any(that: isRoute<String?>(named: '/pincode_screen')),
87-
)).thenAnswer((_) async => null);
85+
when(
86+
() => navigator.push(
87+
any(
88+
that: isRoute<String?>(
89+
whereName: equals('/pincode_screen'),
90+
),
91+
),
92+
),
93+
).thenAnswer((_) async => null);
8894

8995
await tester.pumpTest(
9096
builder: (context) {

lib/mockingjay.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export 'package:mocktail/mocktail.dart';
66

77
export 'src/matchers.dart';
88
export 'src/mock_navigator.dart';
9+
export 'src/tester_extensions.dart';

0 commit comments

Comments
 (0)