-
-
Notifications
You must be signed in to change notification settings - Fork 1
Testing
Simon edited this page Jul 23, 2022
·
2 revisions
We use the flutter_test package to execute unit and widget tests.
Every package / directory in lib/ has a corresponding test class in test/tests/<package_name>.dart. Each test class extends MagicTest which provides a structure for both unit and widget testing.
Both unit and widgets tests are grouped via the runUnitTests() and runWidgetTests() correspondingly. Each test class supplies a name which will be used as an identifier for the test. The implementation of the tests is implemented in the methods unitTestImplementation() and widgetTestImplementation. This is where the test() calls from flutter_test are placed.
The file test/unit_test.dart calls every runUnitTest() method from the test/tests/ directory. Same goes for test/widget_test.dart.