I wanted to have a process that would run elm-verify-examples and then elm-test
upon any change in an Elm project's src
or tests
directories.
A command like elm-verify-examples --elm-test-args="--watch"
didn't work for
me (it ran elm-verify-examples
the first time, but only elm-test
on subsequent times,
so instead I used just
and watchexec
to accomplish this:
just
: https://github.com/casey/justwatchexec
: https://github.com/mattgreen/watchexec
brew install just watchexec
Justfile
elm-verify-examples:
elm-verify-examples
elm-test: elm-verify-examples
elm-test
watchexec -w src -w tests just elm-test
This will:
- Watch the
src
andtests
files for any changes - When changes are detected, it will run the
elm-test
command in theJustfile
, which will runelm-verify-examples
first.