📦 Add TapTest
TapTest uses a smart two-package approach that keeps your production app lean while ensuring clean namespace separation and clear separation of concerns - no testing bloat in your release builds!
Add these dependencies to your pubspec.yaml:
dependencies:
...
taptest_runtime: # Lightweight runtime (production-safe)
dev_dependencies:
...
taptest: # Full testing power (dev-only)
Run the command to install the packages:
flutter pub get
💡 Two-Package Strategy: The
taptest_runtimeprovides minimal production code, whiletaptestcontains the full testing framework - keeping your release builds clean and fast!
📁 Project Structure
Create the proper folder structure for organizing your tests. In your project root, create both test and integration_test folders:
Your Flutter Project
┣ 📂 lib
┃ ┗ 📄 main.dart
┣ 📂 test
┗ 📂 integration_test
You can create these folders using your IDE or terminal:
mkdir test integration_test
💡 Folder Purpose: The
testfolder is for so-called widget tests (underrated), whileintegration_testis for tests that run on real devices or emulators.