Flutter, BLoC and Clean Architecture. This project is based on Dart & Flutter - Zero to Mastery [2022] + Clean Architecture course.
- Provider
- Flutter BLoC
- Equatable
- Dartz
- DIO
- Get it
- Test
- Mockito
- Build Runner: Only version 2.3.0 is working for now. (31/10/2022)
Talk with your team and define your own testing pyramid, for example: Quantity of tests from high(bottom) to low(top).
- Integration:
- Low amount of tests
- Test a complete process of your app
- Hard to write and long execution time
- Examples:
- Make a deposit of your banking account
- Create an account of your social media app
- Helpful link: https://docs.flutter.dev/cookbook/testing/integration/introduction
- UI Golden Tests:
- Medium amount of tests
- Compares the current UI of your app with a defined image of this UI
- Not so hard to write and medium execution time
- Examples:
- Are all button state being as we expect them
- Helpful link 1: https://verygood.ventures/blog/alchemist-golden-tests-tutorial
- Helpful link 2: https://medium.com/flutter-community/flutter-golden-tests-common-widgets-with-snapshots-27f83f266cea
- UI Widget Tests:
- Medium amount of tests
- Tests a UI component and the different states of it without business logic
- Not so hard to write and medium execution time
- Examples:
- Shows my UI a reloading spinner after a pull to refresh
- Helpful link: https://docs.flutter.dev/cookbook/testing/widget/introduction
- Business Logic(Unit/BLoC):
- High amount of tests
- Tests only one specific case of your app
- Easy to write and fast execution time
- Examples:
- BLoC/Cubit tests (business logic)
- Utility functions
- Helpful link 1: https://docs.flutter.dev/cookbook/testing/unit/introduction
- Helpful link 2: https://pub.dev/packages/bloc_test