error: The function 'MyApp' isn't defined. (undefined_function at [my_flutter_app] test\widget_test.dart:16) code example
Example: void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp());
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stateless/another_file.dart';
void main() {
testWidgets('My test', (WidgetTester tester) async {
await tester.pumpWidget(MyApp());
});
}