问题描述
用例
codecov 认为 super
需要测试,
不确定是否为此关键字
编写测试- 会很有意义
- 如何编写这样的测试
我想从 coverage 中排除该行,直到我的疑虑消除
问题
如何忽略 dart-lang/coverage
中的一行
解决方法
在 widget_tester.dart
的文档中
testWidgets('MyWidget asserts invalid bounds',(WidgetTester tester) async {
await tester.pumpWidget(MyWidget(-1));
expect(tester.takeException(),isAssertionError); // or isNull,as appropriate.
});
,
我看到了。不完美,但有解决方案
// 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.
,
目前是不可能的
在 dart 和 flutter 中排除代码覆盖行(请参阅此 issue)
我正在消除有关问题的歧义
what is the correct way to test super
keyword