Current section
Files
Jump to
Current section
Files
lib/mix/tasks/project/add/mix_test_watch.ex
defmodule Mix.Tasks.Project.Add.MixTestWatch do
@shortdoc "Adds mix_test_watch for running tests on file changes"
@moduledoc "Adds `mix_test_watch` to automatically run tests on file changes."
use Igniter.Mix.Task
@impl Igniter.Mix.Task
def igniter(igniter) do
{package, version} = Igniter.Project.Deps.determine_dep_type_and_version!("mix_test_watch")
igniter
|> Igniter.Project.Deps.add_dep({package, version, only: [:dev, :test], runtime: false})
|> Igniter.add_notice("Run `mix test.watch` to run tests on file changes")
end
end