randycoulman / mix_test_interactive

Interactive watch mode for Elixir's mix test. https://hexdocs.pm/mix_test_interactive/
MIT License
73 stars 12 forks source link

Allow customization of command used to run tests #63

Closed randycoulman closed 2 weeks ago

randycoulman commented 1 year ago

Currently, the use of mix to run the tests is hard-coded. The actual task to run is configurable, but not the mix part.

This makes certain use cases very difficult, or even impossible. See #59 and #62 for examples.

A possible solution would be to allow a new command (or command/args) configuration option that takes either a string or an array of strings, defaulting to mix. Then, when running the tests, mix_test_interactive would use the provided command to run the tests.

Examples:

# config/config.exs
use Mix.Config

if Mix.env == :dev do
  config :mix_test_interactive,
    command: ["elixir", "--sname", "foo", "-S", "mix"]
end
# config/config.exs
use Mix.Config

if Mix.env == :dev do
  config :mix_test_interactive,
    command: "path/to/my/test_runner.sh"
end