【发布时间】:2020-10-19 00:11:45
【问题描述】:
我正在尝试一些颤振功能,但我的 widget_test.dart 文件中出现错误,我被卡住了。
这是Widget_test.dart文件代码:
void main()
{
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
await tester.pumpWidget((MyApp());
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
【问题讨论】:
-
这是 Counter App 的默认测试代码,您可能已将
MyApp()重命名为其他名称。如果暂时不需要测试,可以直接删除这个测试文件的内容
标签: flutter visual-studio-code