10

let say inside a test folder, I have structure like this

test
 unit_test
    firebase_services
       firestore_user_services_test.dart
    http_services
       http_services_test.dart
    

 widget_test
     login_page_test.dart 
     home_page_test.dart

I have two folders called unit_test and widget_test inside the test folder. I need to run all the tests inside the unit_test only. how to do that ?

because if I run flutter test it will run all the tests inside the test folder. if I run flutter test unit_test, it doesn't run

1
  • 2
    dart.dev/tools/dart-test - they say: "To control which tests run, you can add the paths to directories or files under the test directory:" - i know it is about dart test but they say it should work for flutter test too, they also say: "Another way to run a subset of tests is to use the --name (-n), --tags (-t), or --exclude-tags (-x) flag, adding part or all of the string to match:"
    – pskink
    Commented Sep 9, 2021 at 4:59

1 Answer 1

15

I should run

flutter test test/unit_test

thanks to pskink to point out this documentation

Not the answer you're looking for? Browse other questions tagged or ask your own question.