Skip to content

Flutter/Dart Live Unit Testing like in Visual Studio #2878

Open

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Oct 14, 2020
  2. DanTup commented on Oct 15, 2020

    @DanTup
    Member

    This would be great to do, but it would really need support from the test package to do (I think it'd also be quite complex to know what tests need re-running after a given change). There's an open issue at dart-lang/test#23 though I'm not sure if it's currently on anyones radar.

  3. added
    in testingRelates to test execution of Dart/Flutter tests for end users
    on Oct 15, 2020
  4. added this to the Backlog milestone on Oct 15, 2020
  5. HerrNiklasRaab commented on Oct 15, 2020

    @HerrNiklasRaab
    Author

    Who would be the person that should have this on their radar?

  6. DanTup commented on Oct 15, 2020

    @DanTup
    Member

    Well I'm not sure if it should be on anyones - that's a question about priorities for the test package, of which I don't have any knowledge. Right now there's only two 👍 's on that package:test issue (which are us two 🙂 ) so it's unclear of the demand.

    I did just come across flutter/flutter-intellij#3507 though, which as far as I can tell will watch the test file. It's not as good as described above, but maybe there's some value in it? That said, with the "run test at cursor" command that can be keybound, maybe it wouldn't add a huge amount.

  7. HerrNiklasRaab commented on Oct 15, 2020

    @HerrNiklasRaab
    Author

    It's absolutely not clear that the referenced issue (dart-lang/test#23) would allow for live unit testing when finished. Therefore it's impossible to evaluate the demand based on the referenced issue.

    A more general question:
    When for example this issue would gain a lot of upvotes, but needs functionality from another repo (e.g. language server, test package, flutter), does this has any influence on the priority of the according repo where the functionality needs to be implemented?

  8. changed the title [-]Support Live Unit Testing like in Visual Studio[/-] [+]Flutter/Dart Live Unit Testing like in Visual Studio[/+] on Oct 15, 2020
  9. DanTup commented on Oct 15, 2020

    @DanTup
    Member

    It's absolutely not clear that the referenced issue would allow for live unit testing when finished

    That's fair - the linked issue is a little vague - though dart-lang/test#112 was a little clearer and folded into that issue as a duplicate. I think there are really two parts:

    1. package:test has some sort of watch support to re-run tests when things change (this would be some long-running process, rather than the current way which is a cold start each time you want to run tests)
    2. The watch supports gets more clever about what tests to re-run as you make changes (I think this is much more tricky, but definitely a significantly better feature)

    But if some sort of server-mode was to be implemented, there are a lot of other annoyances that may make sense to wrap up in a fix (for example resoling issues like dart-lang/test#908, dart-lang/test#837, dart-lang/test#1216, and getting a list of tests without having to first run them). It would make the job bigger, but could address a bunch of things.

    Testing is something I think there's room to improve (and I have been trying to improve things incrementally - there have been quite a few improvements in the past few releases, and hopefully there will be many more if people keep filing suggestions :-)).

    When for example this issue would gain a lot of upvotes, but needs functionality from another repo (e.g. language server, test package, flutter), does this has any influence on the priority of the according repo where the functionality needs to be implemented?

    I'm not sure how well I can answer that. Other projects have their own priorities and I don't have much visibility of that beyond what's public (I'm not a Googler and most of my interaction with those teams is via GitHub/Gerrit although I do have some calls with some teams there). I'd imagine if there is a lot of demand for a feature (whether it's in this repo or their own) that it would be considered, though I also suspect it's usually not a case of "should we do this" but rather "of all these great ideas, which ones deliver the most value or can we acheive with the available developers".

  10. HerrNiklasRaab commented on Oct 28, 2020

    @HerrNiklasRaab
    Author
  11. HerrNiklasRaab commented on Oct 30, 2020

    @HerrNiklasRaab
    Author

    @DanTup I don't know if this brings us further, but no doubt that it's very interesting: https://github.com/szotp/hottie

  12. DanTup commented on Nov 3, 2020

    @DanTup
    Member

    That definitely does look interesting :-) As far as I can tell, it's IDE-agnostic too, so is usable in any IDE (and without any specific changes)?

  13. windybranch commented on Jul 9, 2025

    @windybranch

    @DanTup I notice that you've closed #5076 (comment) as a duplicate but I just want to check that the intention with this issue would also be about a command-line feature not just for IDEs?

    Also noticing that flutter/flutter#4719 (comment) is marked as not planned.

    https://github.com/szotp/hottie looks like it's related to a running app which doesn't help with non-widget tests and pure dart code unless I'm missing something...?

  14. DanTup commented on Jul 9, 2025

    @DanTup
    Member

    @DanTup I notice that you've closed #5076 (comment) as a duplicate but I just want to check that the intention with this issue would also be about a command-line feature not just for IDEs?

    This issue tracker / repo is purely for the VS Code extension and there is no command line interface to it. However, implementing this feature likely requires work in dart and or pkg:test because it's unlikely the extension could make good decisions about which tests to re-run when files are modified.

    Also noticing that flutter/flutter#4719 (comment) is marked as not planned.

    That is unfortunate, and it might prevent implementing this for Flutter. However, I still think it's a fair request and worth tracking here (for example to collect 👍 s on).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked on dart / flutterRequires a change in Dart or Flutter to progressin testingRelates to test execution of Dart/Flutter tests for end usersis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions