Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
8322e178
Unverified
Commit
8322e178
authored
Aug 03, 2021
by
Darren Austin
Committed by
GitHub
Aug 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Added 'exclude' parameter to 'testWidgets()'. (#86397)" (#87515)
parent
40739568
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
35 deletions
+2
-35
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+2
-25
widget_tester_test.dart
packages/flutter_test/test/widget_tester_test.dart
+0
-10
No files found.
packages/flutter_test/lib/src/widget_tester.dart
View file @
8322e178
...
@@ -115,14 +115,6 @@ E? _lastWhereOrNull<E>(Iterable<E> list, bool Function(E) test) {
...
@@ -115,14 +115,6 @@ E? _lastWhereOrNull<E>(Iterable<E> list, bool Function(E) test) {
/// each value of the [TestVariant.values]. If [variant] is not set, the test
/// each value of the [TestVariant.values]. If [variant] is not set, the test
/// will be run once using the base test environment.
/// will be run once using the base test environment.
///
///
/// If either [exclude] or [skip] is `true`, then the test will be skipped. The
/// difference is that [skip] is a temporary way to disable a problematic test
/// while a fix is being developed. It should have a comment after it with a
/// link to a tracking issue for the work on re-enabling the test.
///
/// [exclude] is used to indicate that the test is not designed to run under
/// the condition given and should always be skipped when it is `true`.
///
/// If the [tags] are passed, they declare user-defined tags that are implemented by
/// If the [tags] are passed, they declare user-defined tags that are implemented by
/// the `test` package.
/// the `test` package.
///
///
...
@@ -140,26 +132,11 @@ E? _lastWhereOrNull<E>(Iterable<E> list, bool Function(E) test) {
...
@@ -140,26 +132,11 @@ E? _lastWhereOrNull<E>(Iterable<E> list, bool Function(E) test) {
/// expect(find.text('Success'), findsOneWidget);
/// expect(find.text('Success'), findsOneWidget);
/// });
/// });
/// ```
/// ```
///
/// ### Excluded test
/// ```dart
/// testWidgets('Some test that will never make sense for the web', (WidgetTester tester) async {
/// // test code
/// }, exclude: isBrowser);
/// ```
///
/// ### Skipped test
/// ```dart
/// testWidgets('Some flaky test', (WidgetTester tester) async {
/// // test code
/// }, skip: true); // https://github.com/flutter/flutter/issues/12345
/// ```
@isTest
@isTest
void
testWidgets
(
void
testWidgets
(
String
description
,
String
description
,
WidgetTesterCallback
callback
,
{
WidgetTesterCallback
callback
,
{
bool
skip
=
false
,
bool
?
skip
,
bool
exclude
=
false
,
test_package
.
Timeout
?
timeout
,
test_package
.
Timeout
?
timeout
,
Duration
?
initialTimeout
,
Duration
?
initialTimeout
,
bool
semanticsEnabled
=
true
,
bool
semanticsEnabled
=
true
,
...
@@ -207,7 +184,7 @@ void testWidgets(
...
@@ -207,7 +184,7 @@ void testWidgets(
timeout:
initialTimeout
,
timeout:
initialTimeout
,
);
);
},
},
skip:
(
exclude
||
skip
)
?
true
:
null
,
skip:
skip
,
timeout:
timeout
??
binding
.
defaultTestTimeout
,
timeout:
timeout
??
binding
.
defaultTestTimeout
,
tags:
tags
,
tags:
tags
,
);
);
...
...
packages/flutter_test/test/widget_tester_test.dart
View file @
8322e178
...
@@ -738,16 +738,6 @@ void main() {
...
@@ -738,16 +738,6 @@ void main() {
});
});
});
});
group
(
'Skip and exclude work'
,
()
{
testWidgets
(
'skipping a test skips it'
,
(
WidgetTester
tester
)
async
{
expect
(
true
,
false
);
// shouldn't get here
},
skip:
true
);
// https://github.com/someissue
testWidgets
(
'excluding a test skips it'
,
(
WidgetTester
tester
)
async
{
expect
(
true
,
false
);
// shouldn't get here
},
exclude:
true
);
});
group
(
'Pending timer'
,
()
{
group
(
'Pending timer'
,
()
{
late
TestExceptionReporter
currentExceptionReporter
;
late
TestExceptionReporter
currentExceptionReporter
;
setUp
(()
{
setUp
(()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment