Eugleo / magic-racket

The best coding experience for Racket in VS Code
https://marketplace.visualstudio.com/items?itemName=evzen-wybitul.magic-racket
GNU General Public License v3.0
204 stars 27 forks source link

Running test submodules? #39

Closed jackfirth closed 2 years ago

jackfirth commented 3 years ago

In DrRacket, hitting Run runs both the current module, the main module, and the test submodule. In Magic Racket it seems that the Run button runs the module and the main submodule, but not the test submodule. I'd like it to run the tests, since that's usually how I test code as I'm working on it. For context, I don't typically run the entire package's tests while developing, just in CI. Running just the tests I'm working on makes local development much faster and more seamless.

Runi-c commented 3 years ago

Perhaps modifying the run command to send a raco test {file} before running it would be sufficient? It wouldn't be invisible like how DrRacket does it, so I wonder if people might find this to be unexpected behavior if it's not put in another button (Test and Run?)

Eugleo commented 2 years ago

You can achieve this by using VS Code tasks. The next version of Magic Racket (due today) will supply basic Run and Test tasks, which you can combine in whichever task you will want to run. The tasks will be runnable by running Tasks: Run Task, by using assigned keyboard shortcuts, or by using an extension like Task Runner to run them.

jackfirth commented 2 years ago

I've dug up some more information and have a more specific feature request. Based on these docs, there seems to be a standard Test Explorer UI built-in to VS Code that extensions can report discovered tests to. Could Magic Racket do that by default for test submodules?

Eugleo commented 2 years ago

Just on a quick glance it should be possible, but unfortunately I probably won't be able to add it in the near future due to time constraints. Happy to accept a PR for this, though.