GitHoox.Hooks.Test (GitHoox v0.5.0)

Copy Markdown View Source

Runs mix test.

Options

  • :scope:all, :stale, or :related. Default :all.
  • :args — extra CLI args appended after the task name and any scope-derived flag. Default []. Example: ["--warnings-as-errors"].

Argument order: mix test [--stale] <user_args...> [-- <related_test_files>]. The -- before related paths stops mix test parsing a --prefixed path as an option.

Defaults

  • stage_fixed: false
  • files: ~w(**/*.ex **/*.exs)
  • scope: :all

When scope: :related is selected and related_test_files/1 produces an empty list (no lib/foo.ex → test/foo_test.exs mappings exist on disk), the hook returns :ok without invoking mix test. Falling through to a bare mix test would silently run the entire suite, which is the opposite of what the caller asked for.