Use a null default skip value in testWidgets so it can inherit the group's skip flag (#76174)

This commit is contained in:
Jason Simmons 2021-02-17 14:31:03 -08:00 committed by GitHub
parent 93e7d34dc4
commit 6757c7dd47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -108,7 +108,7 @@ typedef WidgetTesterCallback = Future<void> Function(WidgetTester widgetTester);
void testWidgets(
String description,
WidgetTesterCallback callback, {
bool skip = false,
bool? skip,
test_package.Timeout? timeout,
Duration? initialTimeout,
bool semanticsEnabled = true,

View file

@ -52,6 +52,12 @@ void main() {
});
});
group('respects the group skip flag', () {
testWidgets('should be skipped', (WidgetTester tester) async {
expect(false, true);
});
}, skip: true);
group('findsOneWidget', () {
testWidgets('finds exactly one widget', (WidgetTester tester) async {
await tester.pumpWidget(const Text('foo', textDirection: TextDirection.ltr));