-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn when tests are accidentally disabled due to nesting within setUp() method #1961
Comments
Normally we would error for any calls to However it looks like if you have a import 'package:test/test.dart';
void main() {
setUp(() {
test('hello', () {
expect(1, 2);
});
});
} The above for example does not fail, but if you add a real test after the call to |
From a practical standpoint I am not sure how to really resolve this, we don't want to run all |
One possible fix could be to warn if we see any That should catch most cases as long as any of those tests are actually ran in some configuration. |
Closes #1961 After declaring a group check for declared tests, if there were none add a synthetic test that fails with an error about the empty group.
These tests had been commented out since the original commit in this repo even though most of them would pass. With these tests commented out the suite has an empty `group` which may become disallowed. dart-lang/test#1961 Change double quotes to single quotes. Skip a test which is currently failing due to an error parsing a float value with a single digit.
These tests had been commented out since the original commit in this repo even though most of them would pass. With these tests commented out the suite has an empty `group` which may become disallowed. dart-lang/test#1961 Change double quotes to single quotes. Skip a test which is currently failing due to an error parsing a float value with a single digit.
Hello,
We recently discovered that several tests were accidentally nested inside a
setUp()
method.While the tests compile, they were not actually run by the test runner, and we had no way to detect this. We only happened to notice coincidentally.
It would be helpful if the test runner could warn that tests are disabled when this happens.
Thanks for your consideration.
Rachel
The text was updated successfully, but these errors were encountered: