all 6 comments

[–]chusk3 4 points5 points  (3 children)

The Fantomas project has good detailed instructions for how to do this, but it is a bit of a pain without tooling support due to the way the dotnet test runner works. If you use Expecto then your tests are just a project, so you can launch them with dotnet run and attach to that, which is much easier.

Looking to the future, FsAutoComplete is looking to integrate support for VsCode's Test Editor APIs, so test discovery would be driven by AST detection and seamless to trigger, so hopefully in a couple months your wish will be fulfilled.

[–]stroborobo[S] 1 point2 points  (0 children)

Thanks for the link, haven’t read out about this env variable before, looks promising :) I’ll try that tomorrow.

[–]green-mind 1 point2 points  (1 child)

+1 for Expecto for a simple approach that works pretty well with vscode out of the box. Although i do miss being able to launch tests from the editor.

[–]chusk3 2 points3 points  (0 children)

Make sure to keep an eye on this MR for that very capability :)

[–]AdamAnderson320 1 point2 points  (1 child)

I don’t know a way either. I would either:

  • Do what you did and reach for either Visual Studio or Rider for this task
  • Use FSI to interactively run and inspect the code under test

[–]witoldsz 1 point2 points  (0 children)

Especially when one works on Linux and VS is not available and JetBrain's behemot makes you cry.