From ebb479e5e2395d26fc368c9b9d534e935a292740 Mon Sep 17 00:00:00 2001 From: Mathias Date: Wed, 21 Aug 2024 18:50:42 +0300 Subject: [PATCH] feat(mix): add mix plugin test.watch (#10963) --- plugins/mix/README.md | 1 + plugins/mix/_mix | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/mix/README.md b/plugins/mix/README.md index f0258fe88..9bbe53a41 100644 --- a/plugins/mix/README.md +++ b/plugins/mix/README.md @@ -17,3 +17,4 @@ plugins=(... mix) | Ecto | [Ecto](https://hexdocs.pm/ecto/Ecto.html) | | Hex | [Hex](https://hex.pm/) | | Nerves | [Nerves](https://nerves-project.org/) | +| mix_test_watch | [mix_test_watch](https://hex.pm/packages/mix_test_watch) | diff --git a/plugins/mix/_mix b/plugins/mix/_mix index 7940ff1c9..656c7fe19 100644 --- a/plugins/mix/_mix +++ b/plugins/mix/_mix @@ -109,6 +109,7 @@ _1st_arguments=( 'release.init:Generates sample files for releases' 'run:Run the given file or expression' "test:Run a project's tests" + "test.watch:Run a project's tests continuously using hex package mix_test_watch" 'test.coverage:Build report from exported test coverage' 'xref:Prints cross reference information' '--help:Describe available tasks' @@ -120,7 +121,7 @@ __task_list () local expl declare -a tasks - tasks=(app.config app.start app.tree archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.tree deps.unlock deps.update do ecto.create ecto.drop ecto.dump ecto.gen.migration ecto.gen.repo ecto.load ecto.migrate ecto.migrations ecto.rollback escript escript.build escript.install escript.uninstall firmware firmware.burn firmware.image format help hex hex.audit hex.build hex.config hex.docs hex.info hex.organization hex.key hex.outdated hex.owner hex.package hex.publish hex.registry hex.repo hex.retire hex.search hex.sponsor hex.user loadconfig local local.hex local.phoenix local.phx local.public_keys local.rebar nerves.artifact nerves.artifact.get nerves.info nerves.new nerves.release.init new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.auth phx.gen.cert phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.live phx.gen.notifier phx.gen.presence phx.gen.schema phx.gen.secret phx.gen.socket phx.new phx.new.ecto phx.new.web phx.routes phx.server profile.cprof profile.eprof profile.fprof release release.init run test test.coverage xref) + tasks=(app.config app.start app.tree archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.tree deps.unlock deps.update do ecto.create ecto.drop ecto.dump ecto.gen.migration ecto.gen.repo ecto.load ecto.migrate ecto.migrations ecto.rollback escript escript.build escript.install escript.uninstall firmware firmware.burn firmware.image format help hex hex.audit hex.build hex.config hex.docs hex.info hex.organization hex.key hex.outdated hex.owner hex.package hex.publish hex.registry hex.repo hex.retire hex.search hex.sponsor hex.user loadconfig local local.hex local.phoenix local.phx local.public_keys local.rebar nerves.artifact nerves.artifact.get nerves.info nerves.new nerves.release.init new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.auth phx.gen.cert phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.live phx.gen.notifier phx.gen.presence phx.gen.schema phx.gen.secret phx.gen.socket phx.new phx.new.ecto phx.new.web phx.routes phx.server profile.cprof profile.eprof profile.fprof release release.init run test test.watch test.coverage xref) _wanted tasks expl 'help' compadd $tasks } @@ -148,6 +149,9 @@ case $state in (test) _files ;; + (test.watch) + _files + ;; (run) _files ;;