Muex.Reporter.Json (Muex v0.7.0)

View Source

JSON reporter for mutation testing results.

Exports results in structured JSON format for CI/CD integration.

Each mutation entry includes a patch object with before and after code snippets (or null when the mutation does not carry the original and mutated AST), so survived mutants can be reproduced from the report alone.

Summary

Functions

Generates JSON report from mutation results.

Returns JSON string from mutation results without writing to file.

Functions

generate(results, opts \\ [])

@spec generate(
  [map()],
  keyword()
) :: :ok | {:error, term()}

Generates JSON report from mutation results.

Parameters

  • results - List of mutation results
  • opts - Options:
    • :output_file - Path to output file (default: "muex-report.json")

Returns

:ok after writing the JSON file

to_json(results)

@spec to_json([map()]) :: String.t()

Returns JSON string from mutation results without writing to file.

Parameters

  • results - List of mutation results

Returns

JSON string