# `ExUnitJSON.Formatter`
[🔗](https://github.com/ZenHive/ex_unit_json/blob/main/lib/ex_unit_json/formatter.ex#L1)

ExUnit formatter that outputs test results as JSON.

This GenServer receives events from ExUnit during test execution
and accumulates results. When the test suite finishes, it outputs
a complete JSON document with all test results and summary statistics.

## Usage

Configure ExUnit to use this formatter:

    ExUnit.configure(formatters: [ExUnitJSON.Formatter])

Or use the `mix test.json` task which configures this automatically.

## Events Handled

  * `{:suite_started, opts}` - Captures seed and start time
  * `{:test_finished, test}` - Accumulates individual test results
  * `{:module_finished, module}` - Tracks module-level failures (setup_all)
  * `{:suite_finished, times_us}` - Outputs final JSON

# `t`

```elixir
@type t() :: %ExUnitJSON.Formatter{
  modules: [map()],
  opts: keyword(),
  seed: non_neg_integer() | nil,
  start_time: integer() | nil,
  tests: [map()]
}
```

Formatter state accumulating test results during a test run

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

---

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