用例
codecov认为super
需要测试,
不确定是否为此关键字编写测试
- 会很有意义
- 如何编写这样的测试
在我的疑虑消除之前,我想将该行排除在覆盖范围之外
问题
我如何忽略一行dart-lang/coverage
我看到了这个。不完美,但有解决方案
// 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.
在文档中widget_tester.dart
testWidgets('MyWidget asserts invalid bounds', (WidgetTester tester) async {
await tester.pumpWidget(MyWidget(-1));
expect(tester.takeException(), isAssertionError); // or isNull, as appropriate.
});