sidlatau / neotest-dart

30 stars 8 forks source link

feat: support monorepo #13

Open IgorKhramtsov opened 7 months ago

IgorKhramtsov commented 7 months ago

In my project, we are using monorepo, so the project structure looks like this:

flutter-monorepo
  melos.yaml
  packages
    -- core
    -- module 1
    -- module 2
    -- example

I open nvim from the flutter-monorepo directory, and when I try to run a test from any package, it looks like flutter test command is executed from that flutter-monorepo directory because I am getting errors like "Couldn't resolve the package ... in ..." for every import line.

This change will look for the flutter project of the test file that should be run and use it as the cwd for the command.

lewandowski-jan commented 5 months ago

I was getting error "No pubspec.yaml found" when trying to run nearest test in test/some_test.dart, with this change it also fixes my issue.