Skip to content

Commit d1bd6bb

Browse files
committed
fix: typo
1 parent 49461f1 commit d1bd6bb

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

lib/flutter_hooks_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Future<_HookTestingAction<T, P>> buildHook<T, P>(
1919
});
2020
}
2121

22-
Widget warpedBuilder([P? props]) =>
22+
Widget wrappedBuilder([P? props]) =>
2323
wrapper == null ? builder(props) : wrapper(builder(props));
2424

25-
await _build(warpedBuilder(initialProps));
25+
await _build(wrappedBuilder(initialProps));
2626

27-
Future<void> rebuild([P? props]) => _build(warpedBuilder(props));
27+
Future<void> rebuild([P? props]) => _build(wrappedBuilder(props));
2828

2929
Future<void> unmount() => _build(Container());
3030

test/flutter_hooks_test_test.dart

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ void main() {
3838
testWidgets('Using flutter_hooks_test', (tester) async {
3939
// After
4040
var buildCount = 0;
41-
final result = await buildHook((_) {
42-
buildCount++;
43-
return useUpdate();
44-
});
41+
final result = await buildHook(
42+
(_) {
43+
buildCount++;
44+
return useUpdate();
45+
},
46+
wrapper: (child) => Container(child: child),
47+
);
4548

4649
expect(buildCount, 1);
4750
final update = result.current;
@@ -57,7 +60,11 @@ void main() {
5760

5861
testWidgets('should unmount after unmount()', (tester) async {
5962
final effect = MockEffect();
60-
final result = await buildHook((_) => useMount(() => effect()));
63+
final result = await buildHook(
64+
(_) => useMount(
65+
() => effect(),
66+
),
67+
);
6168
verify(effect()).called(1);
6269
verifyNoMoreInteractions(effect);
6370
await result.unmount();

0 commit comments

Comments
 (0)