Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Co-locate flutter test files to source

Putting test files in the test directory involves mental gymnastics of remembering to move test file when sources move or to even find a corresponding test file.

Is there a way in flutter to place test files next the source?

flutter test -h doesn't have any path related options.

like image 937
nilobarp Avatar asked Oct 14 '25 02:10

nilobarp


1 Answers

This can be achieved with

flutter test lib/**/*_test.dart

Found the hint from Dart test package readme at https://github.com/dart-lang/test/tree/master/pkgs/test#running-tests

like image 69
nilobarp Avatar answered Oct 18 '25 07:10

nilobarp