From 590cb8ffc049fe0cefe7d7203d491726cca7b32d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 11 May 2023 20:50:44 +0100 Subject: [PATCH] feat(justfile): add test-watch recipe Automatically re-run tests when files change using nodemon. --- templates/justfile.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/justfile.twig b/templates/justfile.twig index b391be1..77e1c9b 100644 --- a/templates/justfile.twig +++ b/templates/justfile.twig @@ -24,6 +24,9 @@ test *args: {% else %} {{ "just _run php phpunit --colors=always {{ args }}" | raw }} {% endif %} + +test-watch *args: + nodemon --ext "*" --watch "." --exec "just test {{ args }} || exit 1" --ignore */sites/simpletest {% endif %} {% if "drupal-project" is same as type %} @@ -96,7 +99,7 @@ test-commit: {% endif %} _exec +args: - {{ "docker compose exec {{ args }}" | raw }} + {{ "docker compose exec -T {{ args }}" | raw }} _run service command *args: docker compose run \