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( void testWidgets(
String description, String description,
WidgetTesterCallback callback, { WidgetTesterCallback callback, {
bool skip = false, bool? skip,
test_package.Timeout? timeout, test_package.Timeout? timeout,
Duration? initialTimeout, Duration? initialTimeout,
bool semanticsEnabled = true, 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', () { group('findsOneWidget', () {
testWidgets('finds exactly one widget', (WidgetTester tester) async { testWidgets('finds exactly one widget', (WidgetTester tester) async {
await tester.pumpWidget(const Text('foo', textDirection: TextDirection.ltr)); await tester.pumpWidget(const Text('foo', textDirection: TextDirection.ltr));