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.
This commit is contained in:
Ian Hickson 2024-01-22 16:49:07 -08:00 committed by GitHub
parent 15ceca93a4
commit 5dc3b1894f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -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.

View File

@ -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<void> testExecutable(FutureOr<void> Function() testMain, {String? namePre
} else {
goldenFileComparator = await FlutterLocalFileComparator.fromDefaultComparator(platform);
}
await testMain();
}