mix-test.watch
mix-test.watch copied to clipboard
`test.watch` for one test file runs all tests instead
Following the instructions in the README, I tried to run a single test file like so, but it does not behave as expected:
Expected (same output as mix test test/path_to_test_file.exs
) :
C:\path_to_project\server (develop -> origin)
λ mix test.watch test/path_to_test_file.exs
Finished in 0.2 seconds
3 tests, 0 failures
Randomized with seed 726000
Actual:
C:\path_to_project\server (develop -> origin)
λ mix test.watch test/path_to_test_file.exs
Running tests...
...........**................................................................................................................................................................*........................
Finished in 2.3 seconds
198 tests, 0 failures, 3 skipped
Randomized with seed 484000
I am on windows 10, mix deps is as so:
...
{:mix_test_watch, "~> 0.8", only: :dev, runtime: false},
...
Hi, thanks for the report.
I'm unable to reproduce this on my Linux machine. Could you provide a minimal reproduction of the problem and upload the project to GitHub? It would help determine if the problem is windows or something else.
Thank you.
I've reproduced it here: https://github.com/Ziinc/mix-test-watch-repro
Thanks for the super prompt reply!
Seems like the command
variable containing build tasks cmds isn't passed to the windows cmd
command
https://github.com/lpil/mix-test.watch/blob/6dc3973076e82a2735d084387c351d25b098a6cb/lib/mix_test_watch/port_runner/port_runner.ex#L16
as compared to the linux version:
https://github.com/lpil/mix-test.watch/blob/6dc3973076e82a2735d084387c351d25b098a6cb/lib/mix_test_watch/port_runner/port_runner.ex#L19
Great catch!! Would you like to make a PR fixing this?
Made: https://github.com/lpil/mix-test.watch/pull/104
Isn't completely fixed though, there's a weird double quote issue that I explained in the PR.