avoid-skipping-tests
Warns when a test file, individual test or test group is skipped.
⚙️ Config
Set allow-explained (default is false) to allow skipped test that have a descriptive label.
analysis_options.yaml
dcm:
rules:
- avoid-skipping-tests:
allow-explained: false
Example
❌ Bad:
// LINT: Avoid adding '@Skip()' to test files.
()
library;
import 'package:test/test.dart';
void main() {
// LINT: Avoid adding 'skip: true' to individual tests or test groups.
test('some test', skip: true, () {
final array = [1, 2, 3];
expect(array, hasLength(1));
});
}
✅ Good:
()
library;
import 'package:test/test.dart';
void main() {
test('some test', skip: true, () {
final array = [1, 2, 3];
expect(array, hasLength(1));
});
}