4

use case

codecov sees super as in need for test,

enter image description here

not sure being sure if writing a test for this keyword

  • would be meaningful
  • how to write such a test

I'd like to exclude the line from coverage until my doubts are cleared

question

how do I ignore a line in dart-lang/coverage

Francesco Iapicca
  • 2,618
  • 5
  • 40
  • 85

3 Answers3

10

I see this. Not perfect, but a solution

// coverage:ignore-line to ignore one line.
// coverage:ignore-start and // coverage:ignore-end to ignore range of lines inclusive.
// coverage:ignore-file to ignore the whole file.
lsaudon
  • 1,263
  • 11
  • 24
2

This might help meanwhile:

// coverage:ignore-start
}) : super(
begin: begin,
end: end,
);
// coverage:ignore-end
Alb Bolush
  • 2,198
  • 2
  • 9
  • 8
1

In documentation for widget_tester.dart

testWidgets('MyWidget asserts invalid bounds', (WidgetTester tester) async {
  await tester.pumpWidget(MyWidget(-1));
  expect(tester.takeException(), isAssertionError); // or isNull, as appropriate.
});
lsaudon
  • 1,263
  • 11
  • 24