tcoopman
Mix test feature: shortcut to run last tests?
some context, I’m running helix+tmux and have some shortcuts to run my tests. I’ve configured some shortcuts like: run line, run file, run all, run stale, run failed tests.
I’d like to be able to have a shortcut: run lasts ran tests. Whatever they were.
The reason is that for example: run tests on a line only works when I’m on that line of the tests.
Let’s say there is a bug, I’m trying to fix the test and I want to run the test again. Now I need to jump back to the testfile. A lot quicker would be: run that last test again.
Does anyone have an idea if this would be possible?
Marked As Solved
RudManusachi
How do you “run line”? If it somehow extracts file path and a line number to run
mix test <file_path>:<line_number>
Then perhaps we could come up with a command that takes the previous command from $history or the previous one that starts with “mix test” (from zsh or bash history or whatever shell is used)?
Also Liked
tcoopman
This is the command that I came up with: eval (atuin search --limit 1 --format "{command}" r/^mix test/)
I’m using https://atuin.sh/ and fish shell. So if you want to do something similar you probably will need to change it.








