ewintr.nl

Quick go test clycle with reflex

While you are working on some piece of code, it is nice to have some feedback about whether you broke or fixed something by running the relevant unit tests. To automate this I usually have a terminal window open with the following command:

$ reflex -r '\.go$' -- sh -c 'clear && go test -v ./web/model --run TestEvent'

Remember, reflex is only triggered by changes on the filesystem. After entering the command, nothing happens until you save a .go file.

Sources