Check out example codes for "void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp());". It will help you in understanding the concepts better.

Code Example 1

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 {
    // Build our app and trigger a frame.
    await tester.pumpWidget(MyApp());
  });
}

Learn ReactJs, React Native from akashmittal.com