elementary_test
2.1.1, released a year ago by elementaryteam.dev
Testing library for apps built with the Elementary architecture.
What it does
Provides tools and the testWidgetModel function to easily test WidgetModels and manage their lifecycle phases when using the Elementary architecture package.
AI-written summary of version 2.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building Flutter applications using the elementary architecture package
- You need to test WidgetModels and manage their lifecycle events in tests
Skip it when
- You are not using the elementary architecture package
- You are looking for a general-purpose widget testing or BLoC testing library
Strengths
- Simplifies testing of Elementary WidgetModels
- Provides lifecycle manipulation tools like tester.init() and tester.didChangeDependencies()
Weaknesses
- Strictly tied to the elementary ecosystem
- Limited utility outside of the Elementary architecture
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
void main() {
testWidgetModel<TestPageWidgetModel, TestPageWidget>(
'calculatingState test',
setUpWm,
(wm, tester, context) async {
tester.init();
expect(wm.calculatingState.value, isFalse);
},
);
}Alternatives
Packages that do the same job and could replace elementary_test.
- bloc_test
A testing library that makes it easy to test blocs and cubits.
82Compare - flutter_svg_test
A testing library for finding and verifying flutter_svg images in widget tests.
66Compare - alchemist
Streamlined golden testing tool for Flutter with local and CI-safe output support
94Compare - patrol_log
Log package for Patrol, a Flutter-native UI testing framework
87Compare
Works with
Packages commonly used together with elementary_test: ones it builds on, ones built on it, and its own family.
- mocktailelementary_test depends on itDart mock library with null safety support and no manual mocks or code generation.
- elementaryelementary_test depends on itAn MVVM architecture library for Flutter that separates UI, logic, and data layers.
- elementary_helperSame familyHelpers for the Elementary architecture including state notifiers, builders, and execution mixins.