question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support debugging Flutter widget tests

See original GitHub issue

It’d be nice to get https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/ide_config.dart to set up tasks.json such that when in a file that uses testWidgets from import package:flutter_test/flutter_test.dart, it could automatically invoke flutter test against that file and debug with breakpoints on cmd-shift-T.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:35
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
DanTupcommented, Mar 19, 2018

Ok, the way this works for now is:

When you hit F5 in a flutter project, if there is no program specified in your launch.json (or you don’t have one) and the active file is in the test folder, then it will be launched via flutter test. So, if you have a test file open and hit F5 it’ll run that, otherwise it’ll launch your app as usual.

I’m going to create a beta release of v2.11 in the next few days and would really appreciate some testing/feedback of this as there have been some significant changes to make it work (we now control which debug adapter is used and launch it in-process, whereas it used to be controlled by Code and launched in its own process).

0reactions
vogellacommented, Nov 20, 2019

Thanks @DanTup for this, every useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Flutter apps
source-level debugger · widget inspector that displays a visual widget tree, and “widget select” mode where you select a widget in the app...
Read more >
An introduction to widget testing - Flutter documentation
In the introduction to unit testing recipe, you learned how to test Dart classes using the test package. To test widget classes, you...
Read more >
Debugging Flutter apps programmatically
How to enable various debugging tools from your code and at the command line. ... To dump the state of the Widgets library,...
Read more >
Using the debugger - Flutter documentation
Note: The debugger works with all Flutter and Dart applications. Note: DevTools hides the Debugger tab if the app was launched from VS...
Read more >
Testing Flutter apps
The more features your app has, the harder it is to test manually. Automated tests help ensure that your app performs correctly before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found