Home > Net >  Flutter, run all tests in android studio
Flutter, run all tests in android studio

Time:10-03

I need to be able to run all tests at once in my flutter project.

I can run each individual test function or all tests in a single .dart file but when I attempt to run all tests in the project I get a cache error:

Could not find a file named "pubspec.yaml" in "C:\Users\Vahid\AppData\Local\Pub\Cache\hosted\pub.dartlang.org_fe_analyzer_shared-26.0.0".

That path is not where I installed flutter. I have flutter in C:\fluttersdk which is also the path that I provided to android studio when creating this project.

That file that Android Studio cannot locate, is actually there in the right path C:\fluttersdk\.pub-cache\hosted\pub.dartlang.org\_fe_analyzer_shared-26.0.0.

How should I set Android Studio to look for that file in the correct path?

I tried adding a PUB_CACHE environment variable and appending it to PATH with no avail.

CodePudding user response:

  1. Add a new configuration

Add a new configuration

  1. Select all tests in a directory

Select all tests in a directory

  1. Run all your tests as you would run your app You can just run your tests(1) or run them with coverage(2)

Run tests

  • Related