diff --git a/examples/testing/integration_tests/how_to/integration_test/counter_test.dart b/examples/testing/integration_tests/how_to/integration_test/counter_test.dart index a8e4462ee8..aacd0c7425 100644 --- a/examples/testing/integration_tests/how_to/integration_test/counter_test.dart +++ b/examples/testing/integration_tests/how_to/integration_test/counter_test.dart @@ -1,10 +1,13 @@ +// #docregion initial import 'package:flutter_test/flutter_test.dart'; import 'package:how_to/main.dart'; import 'package:integration_test/integration_test.dart'; void main() { + // #enddocregion initial IntegrationTestWidgetsFlutterBinding.ensureInitialized(); // NEW + // #docregion initial testWidgets('tap on the floating action button, verify counter', (tester) async { // Load app widget. @@ -27,3 +30,4 @@ void main() { expect(find.text('1'), findsOneWidget); }); } +// #enddocregion initial diff --git a/src/testing/integration-tests/index.md b/src/testing/integration-tests/index.md index 8d8b484b68..4de3b8ca45 100644 --- a/src/testing/integration-tests/index.md +++ b/src/testing/integration-tests/index.md @@ -88,14 +88,14 @@ Changed 9 dependencies! In your project, create a new directory `integration_test` with a new file, `_test.dart`: - + ```dart import 'package:flutter_test/flutter_test.dart'; import 'package:how_to/main.dart'; import 'package:integration_test/integration_test.dart'; void main() { - testWidgets('tap on the floating action button, verify counter', + testWidgets('tap on the floating action button, verify counter', (tester) async { // Load app widget. await tester.pumpWidget(const MyApp());