This project is created to show how to write different tests in flutter.
How to Test a Flutter App: Unit, UI, Integration, and Bloc Tests
- Unit tests
- Widget tests
- Cubit/Bloc tests
- Integration tests
bloc - A predictable state management library that helps implement the BLoC (Business Logic Component) design pattern.
flutter_bloc - Flutter Widgets that make it easy to implement the BLoC (Business Logic Component) design pattern.
http - A composable, multi-platform, Future-based API for HTTP requests.
bloc_test - A testing library which makes it easy to test blocs. Built to be used with the bloc state management package.
equatable - A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.
mocktail - A Dart mock library which simplifies mocking with null safety support and no manual mocks or code generation.
- Clone the repo.
$ git clone https://github.com/perpetio/flutter_tests.git
- Open project in VSCode or Android studio.
- Run tests.