Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where should tests for flutter be kept

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?

like image 248
Arnold Rimmer Avatar asked Apr 22 '19 07:04

Arnold Rimmer


1 Answers

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.

like image 144
flarkmarup Avatar answered Sep 28 '22 08:09

flarkmarup