如何忽略`dart-lang/coverage`中的一行
how to ignore a line in `dart-lang/coverage`
用例
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)
我正在消除关于
用例
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)
我正在消除关于