# `GitHoox.Hooks.Test`
[🔗](https://github.com/sgerrand/git_hoox/blob/v0.5.0/lib/git_hoox/hooks/test.ex#L1)

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`

## `:related` with no resolvable tests

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
