https://github.com/hgschandeepa/flutter-unit-testing
This repository is designed to help developers understand and implement unit testing in Flutter applications. It also covers API testing and Firebase functional testing to ensure robust and reliable Flutter apps.
https://github.com/hgschandeepa/flutter-unit-testing
firestore flutter http mock mokito sharedpreferences testing
Last synced: 6 months ago
JSON representation
This repository is designed to help developers understand and implement unit testing in Flutter applications. It also covers API testing and Firebase functional testing to ensure robust and reliable Flutter apps.
- Host: GitHub
- URL: https://github.com/hgschandeepa/flutter-unit-testing
- Owner: HGSChandeepa
- Created: 2024-11-20T17:14:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-12-14T12:35:01.000Z (10 months ago)
- Last Synced: 2025-04-12T04:19:42.797Z (6 months ago)
- Topics: firestore, flutter, http, mock, mokito, sharedpreferences, testing
- Language: Dart
- Homepage:
- Size: 285 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flutter Unit Testing Guide
Welcome to the **Flutter Unit Testing Guide** repository! 🚀
This repository is designed to help developers understand and implement **unit testing** in Flutter applications. It also covers **API testing** and **Firebase functional testing** to ensure robust and reliable Flutter apps.
## 📚 Topics Covered
1. **Unit Testing Basics**
- What is unit testing?
- Writing your first unit test in Flutter.
- Testing common scenarios with Flutter's `test` package.2. **API Testing**
- Mocking API responses.
- Verifying API call behavior.
- Using packages like `mokito` for efficient testing.3. **Firebase Functional Testing**
- Testing Firebase interactions (e.g., Firestore, Authentication).
- Setting up Firebase emulators for local testing.
- Writing tests for Firebase cloud functions.---
## 🛠️ Tools and Packages Used
- [flutter_test](https://pub.dev/packages/flutter_test): Official Flutter testing library.
- [mockito](https://pub.dev/packages/mockito): For mocking objects and dependencies.
- [http_mock_adapter](https://pub.dev/packages/http_mock_adapter): Mocking HTTP calls.
- [firebase_emulator_suite](https://firebase.google.com/docs/emulator-suite): For Firebase functional testing.---
## 💻 How to Run Tests
1. Clone this repository:
```bash
git clone https://github.com/your-username/Flutter-Unit-Testing.git
cd Flutter-Unit-Testing
```
2. Install dependencies:
```bash
flutter pub get
```
3. Run the tests:
```bash
flutter test
```---
## 🧑💻 Contributing
Contributions are welcome! If you have suggestions or additional testing examples, feel free to open a PR or add them in the issues section.
---
## 📜 License
This project is licensed under the [MIT License](LICENSE).