Do they have to be in the root tests foder? When using react I prefer to keep my tests near the components, can I do this with flutter? If not, is it recommended to store all tests in the one test folder or duplicate the structure of lib?
It depends on the different type of test (unit
, widget
, or integration
) but the need to be located in specific folders.
From Flutters CookBook Guides:
In general, test files should reside inside a test folder located at the root of your Flutter application or package.
Unit and Widget tests must be located in a test
folder.
Integration test must go in a separate directory called test_driver
. Both folders must be located same level as your lib
folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With