Test files main is run even when specific launch config is selected and invoked via menu
See original GitHub issueIf you have a Dart unit test file open with a main
function, even if you click the “green arrow” in the Runs and Debug (as in screenshot below) to try to run a specific Flutter launch config, it will still run the tests in the tests files main()
instead of the selected launch config.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How do I run a single test using Jest? - Stack Overflow
Another way is to run tests in watch mode, jest --watch , and then press P to filter the tests by typing the...
Read more >Debugging in Visual Studio Code
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and...
Read more >Debugging - golang/vscode-go - GitHub
Open a file to debug (either package main source file or the test file) in the editor, and select the Run and Debug...
Read more >Editing Launch Configurations
Open a Launch Configuration Dialog ; Select Run → Run Configurations from the top-level menu (or Run → Debug Configurations or Run →...
Read more >Configure unit tests by using a .runsettings file - Microsoft Learn
To specify a run settings file in the IDE, select Test > Select Settings File. Browse to and select the .runsettings file. Select...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, you should always specify a
program
if you don’t want us to try to infer one from the open file/project. Generally I’d only suggest a launch config without aprogram
if you want to be able to useF5
and have the entry point inferred, but need to set some additional args/env/etc. that wouldn’t otherwise be set by default.Let me know if anything still doesn’t seem to work as expected!
Do you mean for targets without a
program
? If you have an explicitprogram
it should always run that. However if you don’t have one set, the default behaviour is not to runlib/main.dart
, there are a set of rules. It’s something like this:test
orintegration_test
and ends with_test
, although there are some settings to support tests outside of the test folders etc.)bin/
ortool/
, run thatbin/main.dart
,lib/main.dart
)So generally, if you want to always run a specific file, you should add an explicit
program
. Otherwise, you’ll get our best guess at what you want to run.