From 5dc3b1894f8e95c8c969f0af780f467a00bc9d9a Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Mon, 22 Jan 2024 16:49:07 -0800 Subject: [PATCH] Add a comment about how to test flutter_goldens (#141902) This is part 2 of a broken down version of the #140101 refactor. This particular change wasn't in that original refactor but is a note to myself so that I remember how to test each of these changes in the future. --- packages/flutter/test/widgets/basic_test.dart | 1 + packages/flutter_goldens/lib/flutter_goldens.dart | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/flutter/test/widgets/basic_test.dart b/packages/flutter/test/widgets/basic_test.dart index 065c46d757..e15a01c097 100644 --- a/packages/flutter/test/widgets/basic_test.dart +++ b/packages/flutter/test/widgets/basic_test.dart @@ -746,6 +746,7 @@ void main() { expect(properties.properties.first.value, colorToPaint); }); }); + testWidgets('Inconsequential golden test', (WidgetTester tester) async { // The test validates the Flutter Gold integration. Any changes to the // golden file can be approved at any time. diff --git a/packages/flutter_goldens/lib/flutter_goldens.dart b/packages/flutter_goldens/lib/flutter_goldens.dart index eef5ed3939..a55eb286e7 100644 --- a/packages/flutter_goldens/lib/flutter_goldens.dart +++ b/packages/flutter_goldens/lib/flutter_goldens.dart @@ -18,6 +18,10 @@ export 'package:flutter_goldens_client/skia_client.dart'; // repo itself, consider reading this wiki page: // https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package%3Aflutter +// If you are trying to debug this package, you may like to use the golden test +// titled "Inconsequential golden test" in this file: +// /packages/flutter/test/widgets/basic_test.dart + const String _kFlutterRootKey = 'FLUTTER_ROOT'; final RegExp _kMainBranch = RegExp(r'master|main'); @@ -41,7 +45,6 @@ Future testExecutable(FutureOr Function() testMain, {String? namePre } else { goldenFileComparator = await FlutterLocalFileComparator.fromDefaultComparator(platform); } - await testMain(); }